Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied when creating /persistentvolumes subdirectory #34

Closed
tibbe opened this issue Jan 11, 2021 · 3 comments
Closed

Permission denied when creating /persistentvolumes subdirectory #34

tibbe opened this issue Jan 11, 2021 · 3 comments

Comments

@tibbe
Copy link

tibbe commented Jan 11, 2021

It seems that using /persistentvolumes to mount the NFS share is hardcoded and fails since the node doesn't have permission to create that directory (or subdirectories):

I0111 17:40:04.382995       1 controller.go:987] provision "default/test-claim" class "nfs-client": started
I0111 17:40:04.393352       1 event.go:221] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"test-claim", UID:"37b7b714-39c1-43fb-82f2-8cc01b037288", APIVersion:"v1", ResourceVersion:"11830", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/test-claim"
W0111 17:40:04.395679       1 controller.go:746] Retrying syncing claim "default/test-claim" because failures 4 < threshold 15
E0111 17:40:04.396629       1 controller.go:761] error syncing claim "default/test-claim": failed to provision volume with StorageClass "nfs-client": unable to create directory to provision new pv: mkdir /persistentvolumes/default-test-claim-pvc-37b7b714-39c1-43fb-82f2-8cc01b037288: permission denied
I0111 17:40:04.396020       1 event.go:221] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"test-claim", UID:"37b7b714-39c1-43fb-82f2-8cc01b037288", APIVersion:"v1", ResourceVersion:"11830", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "nfs-client": unable to create directory to provision new pv: mkdir /persistentvolumes/default-test-claim-pvc-37b7b714-39c1-43fb-82f2-8cc01b037288: permission denied

I installed the ARM version using helm, like so:

helm install nfs-subdir-external-provisioner . --set nfs.server=192.168.0.194 --set nfs.path=/nfs-storage

My NFS server exports are set up as follows:

$ cat /etc/exports 
/export       192.168.0.0/24(rw,fsid=0,insecure,no_subtree_check,async)
/export/nfs-storage 192.168.0.0/24(rw,nohide,insecure,no_subtree_check,async)
@tibbe tibbe changed the title Permission denied when creating /persistentvolumes sub directory Permission denied when creating /persistentvolumes subdirectory Jan 11, 2021
@tibbe
Copy link
Author

tibbe commented Jan 11, 2021

This is on a clean K3s install on a clean install of Raspberry Pi OS (32-bit). NFS server set up according to https://www.raspberrypi.org/documentation/configuration/nfs.md, except using a different directory (/export/nfs-storage) for the share.

@yonatankahana
Copy link
Contributor

yonatankahana commented Jan 11, 2021

what are the permissions in the folder /export/nfs-storage?

ls -lnd /export/nfs-storage

@tibbe
Copy link
Author

tibbe commented Jan 11, 2021

Seems to have been an issue with folder permissions, as you suggested. Works with:

$ ls -lnd /export/nfs-storage
drwxrwxrwx 3 0 0 4096 Jan 11 18:41 /export/nfs-storage

(i.e. chmod 777).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants