Add postgres init container to resolve permissions for some k3s deployments#1805
Conversation
Add postgres init container if
postgres_data_volume_init is true
This allows users to run arbitrary commands
This is aimed to solve the issue where users may
need to chmod or chown the postgres
data volume for user 26, which is the user
that is running postgres in the sclorg image.
For example, one can now set the follow on the AWX spec:
spec:
postgres_init_container_commands: |
chown 26:0 /var/lib/pgsql/data
chmod 700 /var/lib/pgsql/data
In addition, remove the unneeded
postgres_init_container_resource_requirements parameter
Signed-off-by: Seth Foster <[email protected]>
Co-authored-by: Christian M. Adams <[email protected]>
c53fa96 to
634f52f
Compare
|
@kurokobo I just realized that in your awx-on-k3s repo, there are a couple places where you reference postgres_init_container_resource_requirements If a user has this specified on their AWX spec on upgrade or fresh install, they will get this error: It's probably safer for me to just add back in that parameter and mark it as deprecated, and add a backwards compat shim. I'll add that now. |
…w param Deprecate postgres_init_container_resource_requirements param in favor of postgres_resource_requirements param Co-authored-by: craph <[email protected]> Co-authored-by: kurokobo <[email protected]>
d434ceb to
fbf62d3
Compare
|
I just added the changes mentioned so that the validator does not error if the user has Testing I tested this out with the awx-on-k3s repo with the follow AWX spec: I confirmed that the deployment came up successfully, and that the pg init param works: Then also tested with: I confirmed that the deployment came up successfully. Finally, I did one more with After the deployment finished, I checked that the requests and limits were set correctly. |
|
As follow-up I opened a PR to update the |
Thanks for the confirmation and sending PR, my guide is only unofficial one, so I think my guide should respect the Operator's implementation, and I don't think the Operator needs to adapt my guide. But yes, just marking the param as deprecated is safer. Thanks! |
|
Thank you, adding this finally got that dang pod to work. This needs to be default: |
I am running into this on my end. Probably an easy fix? |

Alternate PR for #1799
Resolves:
This approach allows users to simply set:
This removes the unused
postgres_init_container_resource_requirementsparameter which was never removed when the last postgres init container was removed. I cannot think of a good reason to not just usepostgres_resource_requirements.cc @kurokobo
ISSUE TYPE