-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 and Directory "/var/lib/postgresql/data/pg" exists but is not empty with NFS PVC #792
Comments
This looks relevant #116 (comment) But otherwise I would try asking over at the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since the issue is related to the host environment and not something we could alleviate in the image |
@wglambert yes, that issue does seem relevant. I'll try to go through each of the suggested remedies again. I tried several prior to opening this issue with no luck. For example, the annotation jsvp mentions (volume.beta.kubernetes.io/mount-options: "dir_mode=0777,file_mode=0777,uid=1000,gid=1000") is not relevant to nfs pvs. @yosifkit I think you're right it is related to the uid:gid of the container and the nfs mount, but I'm unable to find any combination of chmod, chown, etc. that works. I tinkered with setting securityContext for the container to no avail. So I think you're right on the cause, but am not versed enough in k8s or even basic linux/nfs permissions to resolve. I've tried several of the recommendations in those issues, but will go back through them to be sure I didn't miss anything. The reason I feel this belongs in docker-hub/postgres and not the main postgres repo is that a lot of the permissions changes are happening in the image. For example: line 15-22 and 182 in Dockerfile. In the end, I think something about those lines is breaking for NFS PVs or at least our particular NFS setup. I do have a SO post active on this as well and will update here if I get resolution there. |
@yosifkit I am doing what you suggest by setting uid and gid to the owner of the directory as well as replacing the container /etc/passwd/ with the host /etc/passwd, however I am still getting permission errors such as
|
Hello. Wokring for me: HOST: |
After a very frustrating couple evenings working through this, it is due to the minikube Vagrant implementation (vs the docker default). Moving away from Vagrant resolved all these. |
For further assistance debugging this (and/or issues like it), I'd suggest trying a dedicated support forum, such as the Docker Community Forums, the Docker Community Slack, or Stack Overflow. |
I am attempting to set up a postgres container with data files stored in an NFS share. When I attempt this the pod fails with status of CrashLoopBackOff. Using kubectl logs , I think it first fails with:
Then subsequent initialization attempts fail with:
As best I can tell, what is happening is:
I see from other issue reports that there have been some changes around this as it previously overwrote data in $PGDATA. I am hoping someone can point me in the right direction on this. In the end I don't need HA or great performance. I just want a small single replica postgres pod where the data is persisted to our storage array (which can expose NFS and other flavors) and not local storage on the kubernetes host.
A couple specific questions:
To repro:
Ensure you have a NFS share exposed and update the yaml below with the correct paths. Then run kubectl apply -f nameoffile.yaml
Run kubectl get pods, observe Error, then CrashLoopBackOff
Run kubectl log pod to observe behavior described above
The text was updated successfully, but these errors were encountered: