-
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
Postgres data folder empty on kubernetes #696
Comments
Currently found an Workaround: Is is only possible to mount the directory It was not possible to move the directory outsite of /var/lib/postgresql/data like /usr/postgresql/data or other locations. |
The answer is here: #103 (comment) (quote below):
While the
So, the database folder must be owned by the user running postgres. The easiest way to do that is to define volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
env:
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
Were those defined the same, i.e.
It is a |
this is such a crazy issue I thought it was a problem on Kubernetes CSI / Filesystem level: digitalocean/csi-digitalocean#289 postgreses Dockerfile enforces you to mount something to but if you mount it to lost two days on tinkering due to this my workaround was to change the PGDATA directory to a totally different one:
please at least improve the documentation and to NOT suggest to mount in |
May be the docker image should not contain the default Without the volume should be the problem solved, too. |
That is #404. We don't recommend using We also point out that on some volumes, you need to use a subdirectory of the mount for the postgres data.
|
This comment has been minimized.
This comment has been minimized.
Thank you for describe the source of my headache trying to deploy Red Hat CodeReady Workspaces on my OpenShift 4.3 lab with a NFS storage class! Using the Operator seems not possible to edit the deployment config yaml to change the path... |
Closing old issue; it seems to be sufficiently resolved. |
Describe the situation
We are using postgres 11.7. We mount the data volume on /var/lib/postgresql via an cider pvc.
When we use the path /var/lib/postgresql/data the mount will be done with the permissions root:postgres. In this case postgres is not able to takeover the ownership for the folder .../data and aborts the startup with the message "Opertation not permitted".
When we mount the dir /var/lib/postgresql we can see the folders /var/lib/postgesql/data and during postgres is running there are all needed files. But after we stopped the container the folder .../data is empty.
What is expected
After shutdown the container there should be all data still available within the folder /var/lib/postgresql/data.
Alternative solutions:
The startup script may be not need the User-Ownership of the folder /var/lib/postgresql/data then it does not interrupt the startup.
Questions:
How to handle postgres with a docker image on kubernetes?
Is the .../data directory an hardlink directy?
Why there are no failes anymore in the directory after shutdown?
Similiar issues:
#103 / #560
The text was updated successfully, but these errors were encountered: