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
Wrong PAM role added to pg_hba #407
Comments
The operator sets up the Spilo conf (env var in a container) correctly:
so looks like a bug in Spilo |
@jens-totemic thanks for the detailed bug report :) |
We just looked at this, seems the operator should add the HUMAN_ROLE also to the spilo config dict. Sergey will test give this a try soonish to resolve this issue. If in a rush just put a layer on top of our spilo with the human_role set. |
Thanks for the quick response @zerg-junior and @Jan-M ! Do you know if the PR will also prevent creating the additional |
I run a quick test with the PR and default manifests, no |
Thanks for confirming @zerg-junior ! |
I'd like to use the PAM support and noticed that the correct role name is not used in all places.
Steps to reproduce
I have set a PAM role in the operator config map:
pam_role_name: mypamusers
. I replaced the entry in this file: https://github.com/zalando-incubator/postgres-operator/blob/master/manifests/configmap.yaml)Then I commented out the lines for
pg_hba:
in the cluster definition in order to use the defaults that add the PAM support. I used this file as my starting point: https://github.com/zalando-incubator/postgres-operator/blob/master/manifests/complete-postgres-manifest.yamlWhen I launch a new cluster using the two files above, I observe two things:
pg_hba.conf
file in the postgres pod looks like this:zalandos
is created in the postgres databaseIt appears that in both cases Spilo uses the ENV variable
HUMAN_ROLE
and it defaults to "zalandos" (see https://github.com/zalando/spilo/blob/master/postgres-appliance/scripts/configure_spilo.py#L349)Expected behaviour
HUMAN_ROLE
variable should be set to value ofpam_role_name
pg_hba.conf
should use the value ofpam_role_name
zalandos
should be added to the postgres databaseThe text was updated successfully, but these errors were encountered: