CSI driver - Using secrets in PVC spec

40 Views Asked by At

I have below spec for pvc and secrets

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: cos-s3-csi-pvc
  namespace: default
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 256Mi
  storageClassName: cos-s3-csi-sc
apiVersion: v1
kind: Secret
type: cos-s3-csi-driver
metadata:
  name: cos-s3-csi-pvc
data:
  # Mounter type e.g. s3fs or rclone for s3fs run echo -n "s3fs" | base64
  mounter: czNmcw==
  # Bucket name
  bucket-name: bmtjb2RlLWRldnRlc3QwMQ==
  access-key: <base64 encoded access key>
  secret-key: <base64 encoded secret key>

With this design, pvc-secret is 1-1 mapping. Is there a way user can use one secret over multiple PVCs.

I have gone through https://kubernetes-csi.github.io/docs/secrets-and-credentials-storage-class.html, but I am unsure if this is what I am exactly looking for.

0

There are 0 best solutions below