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.
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 |
Name | Meaning | Example Value | Mandatory | Default value |
---|---|---|---|---|
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 |
since
DeleteVolumeRequest
does not providemountOptions
, following is the workaround to providemountOptions
forDeleteVolume
, 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-name
andcsi.storage.k8s.io/provisioner-secret-namespace
setting:
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:
- hard
- nfsvers=3