rancher / local-path-provisioner

Dynamically provisioning persistent local storage with Kubernetes
Apache License 2.0
2.07k stars 439 forks source link

Permission denied on RHEL based OS #398

Open atassis opened 2 months ago

atassis commented 2 months ago

After installing the LPP and initializing the PVC with pod, I receive an error for directory creation via helper:

mkdir: can't create directory '/data/local-path-provisioner/pvc-7a3c3fd8-6564-4bd6-a655-8a967e000a4b_default_volume-test-pvc': Permission denied

To fix it, I had to give SELinux attribute to the directory with command:

chcon -Rt container_file_t  /data/local-path-provisioner 

I have seen several issues for the same error, but none of them related to the chcon command and RHEL based distributions like Fedora.

emilianomaccaferri commented 1 month ago

you saved me a lot of time!

atassis commented 1 month ago

Tried to be as clear as possible:) nice to hear that it helped🫶