andyzhangx 8a1b143ead doc: update NFS provisioner example
fix comments

fix comments
2020-10-15 03:24:26 +00:00
..
2020-10-15 03:24:26 +00:00

Set up a NFS Server on a Kubernetes cluster

Note: This example is for development only. Because the NFS server is sticky to the node it is scheduled on, data shall be lost if the pod is rescheduled on another node.

  • To create a NFS provisioner on your Kubernetes cluster, run the following command
kubectl create -f https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/examples/kubernetes/nfs-provisioner/nfs-server.yaml
  • After deploying, a new service nfs-server is created, nfs share path isnfs-server.default.svc.cluster.local:/.

  • To check if the server is working, we can statically create a PersistentVolume and a PersistentVolumeClaim, and mount it onto a sample pod:

kubectl create -f https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/examples/kubernetes/nfs-provisioner/app.yaml

Verify if the newly create deployment is Running:

# kubectl exec -it nfs-busybox-8cd8d9c5b-sf8mx sh
/ # df -h
Filesystem                Size      Used Available Use% Mounted on
...
nfs-server.default.svc.cluster.local:/
                        123.9G     15.2G    108.6G  12% /mnt
...