k3s/examples/nfs
Jan Safranek 20004e0c16 Add e2e tests for Gluster and NFS tests.
- add appropriate server containers into contrib/for-tests/volumes-tester
- the tests are off by default (they need kubelet --allow_privileged=True)
  - enable by 'go run hack/e2e.go ... --ginkgo.focus=Volume'
- add glusterfs tools to list of installed packages on each node
2015-05-25 12:02:41 +02:00
..
exporter Add e2e tests for Gluster and NFS tests. 2015-05-25 12:02:41 +02:00
nfs-data Add ga-beacon analytics to gendocs scripts 2015-05-15 18:56:38 -07:00
README.md Add ga-beacon analytics to gendocs scripts 2015-05-15 18:56:38 -07:00
nfs-server-pod.yaml Add NFS export/import pod examples. 2015-04-02 10:47:21 +02:00
nfs-server-service.yaml Add NFS export/import pod examples. 2015-04-02 10:47:21 +02:00
nfs-web-pod.yaml Stop using dockerfile/* images 2015-04-16 12:20:43 -07:00

README.md

Example of NFS volume

See nfs-web-pod.yaml for a quick example, how to use NFS volume in a pod.

Complete setup

The example below shows how to export a NFS share from a pod and import it into another one.

NFS server part

Define NFS server pod and NFS service:

$ kubectl create -f nfs-server-pod.yaml
$ kubectl create -f nfs-server-service.yaml

The server exports /mnt/data directory as / (fsid=0). The directory contains dummy index.html. Wait until the pod is running!

NFS client

WEB server pod uses the NFS share exported above as a NFS volume and runs simple web server on it. The pod assumes your DNS is configured and the NFS service is reachable as nfs-server.default.kube.local. Edit the yaml file to supply another name or directly its IP address (use kubectl get services to get it).

Define the pod:

$ kubectl create -f nfs-web-pod.yaml

Now the pod serves index.html from the NFS server:

$ curl http://<the container IP address>/
Hello World!

Analytics