fix: failed to archive subdirectory: no such file or dir fix: failed to rename archive pvc archived-pvc-1234 fix: volume name doc: include archive on delete in doc
3.3 KiB
3.3 KiB
Driver Parameters
This driver requires existing and already configured NFSv3 or NFSv4 server, it supports dynamic provisioning of Persistent Volumes via Persistent Volume Claims by creating a new sub directory under NFS server.
storage class usage (dynamic provisioning)
| Name | Meaning | Example Value | Mandatory | Default value |
|---|---|---|---|---|
| server | NFS Server address | domain name nfs-server.default.svc.cluster.local or IP address 127.0.0.1 |
Yes | |
| share | NFS share path | / |
Yes | |
| subDir | sub directory under nfs share | No | if sub directory does not exist, this driver would create a new one | |
| mountPermissions | mounted folder permissions. The default is 0, if set as non-zero, driver will perform chmod after mount |
No | ||
| onDelete | when volume is deleted, keep the directory if it's retain |
delete(default), retain, archive |
No | delete |
- VolumeID(
volumeHandle) is the identifier of the volume handled by the driver, format of VolumeID:
{nfs-server-address}#{sub-dir-name}#{share-name}
example:
nfs-server.default.svc.cluster.local/share#subdir#
PV/PVC usage (static provisioning)
| Name | Meaning | Example 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 nfs-server address, sub directory name and share name: {nfs-server-address}#{sub-dir-name}#{share-name}. |
Yes | |
| volumeAttributes.server | NFS Server address | domain name nfs-server.default.svc.cluster.local or IP address 127.0.0.1 |
Yes | |
| volumeAttributes.share | NFS share path | / |
Yes | |
| volumeAttributes.mountPermissions | mounted folder permissions. The default is 0, if set as non-zero, driver will perform chmod after mount |
No |
Tips
subDir parameter supports following pv/pvc metadata conversion
if
subDirvalue contains following strings, it would be converted into corresponding pv/pvc name or namespace
${pvc.metadata.name}${pvc.metadata.namespace}${pv.metadata.name}
provide mountOptions for DeleteVolume
since
DeleteVolumeRequestdoes not providemountOptions, following is the workaround to providemountOptionsforDeleteVolume, check details here
- create a secret with
mountOptions
kubectl create secret generic mount-options --from-literal mountOptions="nfsvers=3,hard"
- define a storage class with
csi.storage.k8s.io/provisioner-secret-nameandcsi.storage.k8s.io/provisioner-secret-namespacesetting:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nfs-csi
provisioner: nfs.csi.k8s.io
parameters:
server: nfs-server.default.svc.cluster.local
share: /
# csi.storage.k8s.io/provisioner-secret is only needed for providing mountOptions in DeleteVolume
csi.storage.k8s.io/provisioner-secret-name: "mount-options"
csi.storage.k8s.io/provisioner-secret-namespace: "default"
reclaimPolicy: Delete
volumeBindingMode: Immediate
mountOptions:
- nfsvers=4.1