zfs-localpv icon indicating copy to clipboard operation
zfs-localpv copied to clipboard

pvc mountpoint is not accessible from all the pods in shared-mount volume

Open w3aman opened this issue 4 years ago • 2 comments

Environment:

  • ZFS-LocalPV version : 1.0.0
  • Kubernetes version (use kubectl version): 1.18.6
  • Cloud provider or hardware configuration: Rancher cluster on centos 7 with docker container-runtime
  • OS (e.g. from /etc/os-release):
# cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)

What steps did you take and what happened: [A clear and concise description of what the bug is, and what commands you ran.]

Using zfspv shared mount volume, but pvc mount point is not accessible from all the pods which are sharing shared pvc. I created one shared pvc. Deployed the busybox application deployment with multiple replicas but i am only able to access volume mount point from only single pod at a time, not all the pods.

Getting this error in all pods except only one which is running fine:

$ kubectl exec -ti app-busybox-5d6c6dbf5f-47jjv -n test sh
/ # cd busybox/
sh: cd: can't cd to busybox/: Permission denied

What did you expect to happen:

  • Volume mount point should be accessible from all the pods which are sharing the pvc.

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

- This case is failing on only one of my setup given above, but working fine in ubuntu based kubeadm-cluster (k8s: 1.18) and centos-7 based konvoy cluster (k8s 1.17) also. Only failing with rancher cluster.

  • One work-around which work for me: setting selinux level same on all the pods like this: .spec.securityContext.seLinuxOptions.level: "s0:c45,c668"?

  • and other than this, this also can be a work-around: echo 0 >> /sys/fs/selinux/enforce

w3aman avatar Oct 15 '20 13:10 w3aman