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
Fix permission for mounted directory #2261
Conversation
@absoludity, thanks for the fix. I would rather it be a separate statement explaining why it may be necessary to chmod permissions when using hostPath volumes. |
d9d2232
to
53ce822
Compare
@foxish Let me know if that's more what you're after. Thanks |
(due to a [bug when using hostPath volumes](https://github.com/kubernetes/kubernetes/issues/2630)) with: | ||
|
||
```shell | ||
for i in 0 1; do kubectl exec web-$i -- sh -c 'chmod 755 /usr/share/nginx/html'; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need a shell to run chmod
. It should work as just:
for i in 0 1; do kubectl exec web-$i -- chmod 755 /usr/share/nginx/html; done
Did you find that the permissions on index.html
are fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @enisoc , I removed the sh as suggested.
Yes, the perms on index.html are fine:
michael@hpmor2:~/dev/k8s/statefulsets$ for i in 0 1; do kubectl exec web-$i -- ls -la /usr/share/nginx/html/; done
total 8
drwxr-xr-x 2 root root 60 Jan 25 09:23 .
drwxr-xr-x 4 root root 4096 Jan 16 06:20 ..
-rw-r--r-- 1 root root 6 Jan 25 09:23 index.html
total 8
drwxr-xr-x 2 root root 60 Jan 25 09:23 .
drwxr-xr-x 4 root root 4096 Jan 16 06:20 ..
-rw-r--r-- 1 root root 6 Jan 25 09:23 index.html
…bernetes#2260 This is a work-around for kubernetes#2260 until the underlying problem is addressed (kubernetes/kubernetes#2630).
/lgtm |
@enisoc: you can't LGTM a PR unless you are an assignee. In response to this comment:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/lgtm |
/lgtm Comments from Reviewable |
Work-around for #2260 until the underlying problem is addressed (kubernetes/kubernetes#2630 - though not 100%).
This change is