Skip to content

Instantly share code, notes, and snippets.

@Smartich0ke
Created November 4, 2023 22:33
Show Gist options
  • Save Smartich0ke/8e6a0f687bc2e42b0d794e513410e056 to your computer and use it in GitHub Desktop.
Save Smartich0ke/8e6a0f687bc2e42b0d794e513410e056 to your computer and use it in GitHub Desktop.
Simple template for setting up an SMB volume in k8s using csi-driver-smb
apiVersion: v1
kind: Secret
metadata:
name: <name_of_credentials_secret>
annotations: {}
labels: {}
namespace: <namespace_of_credentials_secret>
type: Opaque
data:
domain: <some_domain> # e.g. WORKGROUP
username: <some_smb_user>
password: <password_for_user>
__clone: true
apiVersion: v1
kind: PersistentVolume
metadata:
name: <name_of_pv>
namespace: <namespace_of_pv>
spec:
storageClassName: ""
capacity:
storage: 50Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
mountOptions:
- dir_mode=0777
- file_mode=0777
- vers=3.0
csi:
driver: smb.csi.k8s.io
readOnly: false
volumeHandle: ip-or-host/path/to/share
volumeAttributes:
source: //ip-or-host/path/to/share
nodeStageSecretRef:
name: <name_of_credentials_secret>
namespace: <namespace_of_credentials_secret>
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: <name_of_pvc>
namespace: <namespace_of_pv>
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
volumeName: <name_of_pv>
storageClassName: ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment