Closed shazolKh closed 1 year ago
I'm sorry, but I'm not sure I understand what you're trying to suggest we should do here? From what I can tell, you had a problem with your deployment and you resolved it successfully, and I'm confused why that warranted opening an issue to tell us about it. :sweat_smile: :bow:
I'm sorry, but I'm not sure I understand what you're trying to suggest we should do here? From what I can tell, you had a problem with your deployment and you resolved it successfully, and I'm confused why that warranted opening an issue to tell us about it. 😅 🙇
The point is, the doc on docker hub should be updated (obviously after tests). & I'm sorry for the confusion but I think, people can be benefited from this issue. 🙄🥱
The docs are written for the average Docker use case, so the defined VOLUME /var/lib/postgresql/data
would prevent them from successfully using a mount target on /var/lib/postgresql/
since it would only contain a single directory (data
) that would be mounted elsewhere because of the automatic anonymous volume. So, if they do need their data to not be at the root of the respective volume, then it only works for them if they chose a PGDATA
directory deeper (or outside of) the default volume location.
I don't know the particulars of your setup or exactly why it was failing. I would guess it was permissions based as it seemed like your setup would not allow chown
, but it would accept a directory already populated (from the image) with the correct permissions into the volume claim.
It was helpful for my custom Helm Chart. Thank you @shazolKh !
ERROR
Getting the following error while trying to running the
postgres:13
image on Kubernetes usingStatefulSet
:And in my k8s-manifest file, I used the
mountPath
as/var/lib/postgresql/data
. And the variablePGDATA
as/var/lib/postgresql/data/pgdata
as stated in https://hub.docker.com/_/postgres:SOLUTION
I tried various methods to solve this problem but nothing worked out. After a while, I found out in the Dockerfile of Postgres, at line 27 and line 185, they used the values
/var/lib/postgresql
andPGDATA
:/var/lib/postgresql/data
. So, I changed the values accordingly on my k8s manifest file.AND THIS SOLVED MY ISSUES.