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 issues with non-root user pods #7

Open
xrow opened this issue Aug 14, 2020 · 2 comments
Open

Permission issues with non-root user pods #7

xrow opened this issue Aug 14, 2020 · 2 comments

Comments

@xrow
Copy link

xrow commented Aug 14, 2020

Depending on the type of pod you start the PVs are created with different owners/permissions.

In the pod we do see now permission errors

image

cp: cannot create directory '/var/solr/data/ezplatform': Permission denied

The reason for that is that the folder is owned by root with 755 permissions and the user solr can`t create folders.

A fix could be to create that folders with 777 permissions somehow.

[root@openshift data]# ls -lisa hostpath-provisioner/
total 16
2147488241 4 drwxrwxrwx. 9 root    root 4096 Aug 14 16:47 .
        64 0 drwxrwxrwx. 5 root    root  101 Aug 14 15:48 ..
2147491394 4 drwxr-xr-x. 7 polkitd root 4096 Aug 14 16:48 pvc-0d44ea3c-de3d-11ea-a18f-00259056a256
4299069738 0 drwxr-xr-x. 2 root    root    6 Aug 14 16:47 pvc-0d4e1822-de3d-11ea-a18f-00259056a256
@abhinavsinha1991
Copy link

abhinavsinha1991 commented Aug 17, 2020

use fsGroup: 1000 under securityContext in your pod/container spec

Refer:
https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod

@xrow
Copy link
Author

xrow commented Aug 18, 2020

Hi,

I think I know what your point is. Doesn`t it make sense to support any userid?

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