Bring your own Samba server before using this driver.
get an example
Name | Meaning | Available Value | Mandatory | Default value |
---|---|---|---|---|
source | Samba Server address | //smb-server-address/sharename (Azure File format: //accountname.file.core.windows.net/filesharename ) |
Yes | |
subDir | sub directory under smb share | No | if sub directory does not exist, this driver would create a new one | |
csi.storage.k8s.io/provisioner-secret-name | secret name that stores username , password (domain is optional); if secret is provided, driver will create a sub directory with PV name under source |
existing secret name | No | |
csi.storage.k8s.io/provisioner-secret-namespace | namespace where the secret is | existing secret namespace | No | |
csi.storage.k8s.io/node-stage-secret-name | secret name that stores username , password (domain is optional) |
existing secret name | Yes | |
csi.storage.k8s.io/node-stage-secret-namespace | namespace where the secret is | existing secret namespace | Yes |
- VolumeID(
volumeHandle
) is the identifier of the volume handled by the driver, format of VolumeID:
{smb-server-address}#{sub-dir-name}#{share-name}
example:
smb-server.default.svc.cluster.local/share#subdir#
get an example
Name | Meaning | Available Value | Mandatory | Default value |
---|---|---|---|---|
volumeHandle | Specify a value the driver can use to uniquely identify the share in the cluster. | A recommended way to produce a unique value is to combine the smb-server address, sub directory name and share name: {smb-server-address}#{sub-dir-name}#{share-name} . |
Yes | |
volumeAttributes.source | Samba Server address | //smb-server-address/sharename (Azure File format: //accountname.file.core.windows.net/filesharename ) |
Yes | |
volumeAttributes.subDir | existing sub directory under smb share | No | sub directory must exist otherwise mount would fail | |
nodeStageSecretRef.name | secret name that stores username , password (domain is optional) |
existing secret name | Yes | |
nodeStageSecretRef.namespace | namespace where the secret is | k8s namespace | Yes |
- Use
kubectl create secret
to createsmbcreds
secret to store Samba Server username, password
kubectl create secret generic smbcreds --from-literal username=USERNAME --from-literal password="PASSWORD"
if
subDir
value contains following string, it would be converted into corresponding pv/pvc name or namespace
${pvc.metadata.name}
${pvc.metadata.namespace}
${pv.metadata.name}
since
DeleteVolumeRequest
does not providemountOptions
, following is the workaround to providemountOptions
forDeleteVolume
- create a secret
smbcreds
withmountOptions
kubectl create secret generic smbcreds --from-literal username=USERNAME --from-literal password="PASSWORD" --from-literal mountOptions="dir_mode=0777,file_mode=0777,uid=0,gid=0,mfsymlinks"
- set
csi.storage.k8s.io/provisioner-secret-name: "smbcreds"
in storage class