-
Notifications
You must be signed in to change notification settings - Fork 599
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
Add postgres init container to resolve permissions for some k3s deployments #1805
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 <fosterbseth@gmail.com> Co-authored-by: Christian M. Adams <chadams@redhat.com>
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 <14820052+craph@users.noreply.github.com> Co-authored-by: kurokobo <kuro664@gmail.com>
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! |
Alternate PR for #1799
Resolves:
This approach allows users to simply set:
This removes the unused
postgres_init_container_resource_requirements
parameter 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