csi-driver-nfs/examples
Jiaxun Song 1ad86af1ac test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00
..
README.md test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00
deployment.yaml test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00
nfs-server.yaml test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00
nginx-pod.yaml test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00
pv-nfs-csi.yaml test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00
pvc-nfs-csi-dynamic.yaml test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00
pvc-nfs-csi-static.yaml test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00
statefulset.yaml test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00
storageclass-nfs.yaml test: add more test cases for e2e test 2020-11-17 03:30:55 +00:00

README.md

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
...