# NFS mount is not working

**URL:** <https://discuss.kubernetes.io/t/nfs-mount-is-not-working/6458>\
**Category:** General Discussions\
**Tags:** k8s-release\
**Created:** [May 20, 2019, 3:15pm UTC](https://discuss.kubernetes.io/t/nfs-mount-is-not-working/6458 "2019-05-20T15:15:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jegan\_balu](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/jegan_balu/32/2941_2.png) [@jegan\_balu](https://discuss.kubernetes.io/u/jegan_balu)\
**Post date:** [May 20, 2019, 3:15pm UTC](https://discuss.kubernetes.io/t/nfs-mount-is-not-working/6458/1 "2019-05-20T15:15:24Z")

</div>



---

<div class="post-metadata">

**Author:** ![macintoshprime](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/macintoshprime/32/7121_2.png) [@macintoshprime](https://discuss.kubernetes.io/u/macintoshprime)\
**Post date:** [May 20, 2019, 4:44pm UTC](https://discuss.kubernetes.io/t/nfs-mount-is-not-working/6458/2 "2019-05-20T16:44:54Z")

</div>

Can you provide some more information? Logs or events from the container trying to mount the drive, etc

---

<div class="post-metadata">

**Author:** ![jegan\_balu](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/jegan_balu/32/2941_2.png) [@jegan\_balu](https://discuss.kubernetes.io/u/jegan_balu)\
**Post date:** [May 21, 2019, 3:58am UTC](https://discuss.kubernetes.io/t/nfs-mount-is-not-working/6458/3 "2019-05-21T03:58:23Z")

</div>

Thanks for your reply, here below logs and events.

root@master:~# kubectl logs mysql-0 -n wordpress-ns  
chown: changing ownership of ‘/var/lib/mysql/grastate.dat’: Operation not permitted  
chown: changing ownership of ‘/var/lib/mysql/galera.cache’: Operation not permitted  
chown: changing ownership of ‘/var/lib/mysql/’: Operation not permitted

root@master:~# kubectl get events -n wordpress-ns  
LAST SEEN TYPE REASON OBJECT MESSAGE  
45m Normal Pulled pod/mysql-0 Container image “perconalab/percona-xtradb-cluster:5.6test” already present on machine  
43s Warning BackOff pod/mysql-0 Back-off restarting failed container  
25m Normal Pulled pod/mysql-1 Container image “perconalab/percona-xtradb-cluster:5.6test” already present on machine  
44s Warning BackOff pod/mysql-1 Back-off restarting failed container  
25m Normal Pulled pod/mysql-2 Container image “perconalab/percona-xtradb-cluster:5.6test” already present on machine  
40s Warning BackOff pod/mysql-2 Back-off restarting failed container

---

<div class="post-metadata">

**Author:** ![macintoshprime](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/macintoshprime/32/7121_2.png) [@macintoshprime](https://discuss.kubernetes.io/u/macintoshprime)\
**Post date:** [May 21, 2019, 12:22pm UTC](https://discuss.kubernetes.io/t/nfs-mount-is-not-working/6458/4 "2019-05-21T12:22:42Z")

</div>

How are you mounting the `/var/lib` dirs? It looks like that might be a probable cause as it looks like it’s causing the container to restart constantly.

---

<div class="post-metadata">

**Author:** ![jegan\_balu](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/jegan_balu/32/2941_2.png) [@jegan\_balu](https://discuss.kubernetes.io/u/jegan_balu)\
**Post date:** [May 21, 2019, 2:51pm UTC](https://discuss.kubernetes.io/t/nfs-mount-is-not-working/6458/5 "2019-05-21T14:51:44Z")

</div>

From the root permission is working file,  
but the problem is user permission is not working.  
I created client1 as a user, exports through NFS, when I modified the data from slave1 it’s reflecting to master.  
but when I deploy the percona-xtradb-cluster, ownership issue coming.

master :  
root@master:~# cat /etc/exports  
/home/client1 103.120.176.1/22(rw,sync,all\_squash,no\_subtree\_check,anonuid=1001,anongid=1001)

slave1:  
root@slave1:~# cat /etc/fstab  
103.120.176.30:/home/client1 /home/client1 nfs rw,sync,hard,intr 0 0

root@slave1:~# cat /etc/auto.mount  
/home/client2 -fstype=nfs,rw 103.120.176.30:/home/client2

---

<div class="post-metadata">

**Author:** ![macintoshprime](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/macintoshprime/32/7121_2.png) [@macintoshprime](https://discuss.kubernetes.io/u/macintoshprime)\
**Post date:** [May 22, 2019, 2:09am UTC](https://discuss.kubernetes.io/t/nfs-mount-is-not-working/6458/6 "2019-05-22T02:09:26Z")

</div>

Can’t say I’ve run into that issue yet. You may want to check to see what user is accessing the drive from the cluster and adjust the settings according to that. I’m not an expert in NFS issues.

Here is the example repo for NFS drives and k8s, there might be something in there that might point you in the right direction, [https://github.com/kubernetes/examples/tree/master/staging/volumes/nfs](https://github.com/kubernetes/examples/tree/master/staging/volumes/nfs)
