Description
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:
- But in kubernetes it is not possible to mount an volume not as root user. Just the group is changeable.
- it seem to be an locking issue between postgres and k8s