Can you provide some more information? Logs or events from the container trying to mount the drive, etc
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
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.
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
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