Can pods mount NFS volume

+1 vote
Can a Kubernetes-pod mount an NFS volume?
Jul 15, 2019 in Kubernetes by Jenny
3,384 views

1 answer to this question.

+1 vote

Yes, there's an example here of both an NFS client and server running within pods in the cluster: 

Example: 

Configuring NFS Server

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, which contains dummy index.html. Wait until the pod is running!

Configuring NFS Client

See WEB server pod, which runs a simple web server serving data from the NFS. 

The pod assumes your DNS is set up 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).

Finally, define the pod:

$ kubectl create -f web-pod.yaml
Now the pod serves index.html from the NFS server:
$ curl http://<the container IP address>/
Hello World!
answered Jul 15, 2019 by Sirajul
• 59,230 points
Hi,

Do you know where the YAMLs files about the exemple above is ?
You have to configure those yaml files on the NFS server within the /volumes/nfs directory structure of your kubernetes cluster.

The storage method is at sky-high demand sprawling out far and wide among various verticals. Numerous applications are coming up for providing contented access to people.

One of the ways Kubernetes allow applications to access storage is the standard Network File Service (NFS) protocol. I found a article here which helped me setup nfs provisioner server in kubernetes.

Related Questions In Kubernetes

0 votes
1 answer
0 votes
1 answer

Set volume mount user group and file permissions in kubernetes

There's a setting in Pod Security Context ...READ MORE

answered Jan 16, 2019 in Kubernetes by ajs3033
• 7,300 points
27,959 views
0 votes
1 answer

Kubernetes: Can we use multiple claims out of a persistent volume?

The mapping between persistentVolume and persistentVolumeClaim is ...READ MORE

answered Jul 16, 2019 in Kubernetes by Sirajul
• 59,230 points
6,082 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,476 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
0 votes
1 answer

How can i get all the pods on a node?

You can use the following command to ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 59,230 points
1,073 views
0 votes
1 answer

how can we prioritize pods and preempt them?

A PriorityClass is a non-namespaced object that ...READ MORE

answered Jul 15, 2019 in Kubernetes by Sirajul
• 59,230 points
698 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP