zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.35k stars 979 forks source link

Doubts in pg_hba.conf behavior changes #1720

Open Arun-Trichy opened 2 years ago

Arun-Trichy commented 2 years ago

Hi Team,

We had been using postgres-operator v1.6.3 and spilo-12 where we used to bypass non-ssl connections to postgres using the following configuration in postgresql CRD YAML

  patroni:
    pg_hba:
      - host all all all md5

When we had to migrate to postgres-operator v1.7.1 and spilo-14 in-order to support in-place major version upgrades, we are not able to use the same configuration as mentioned above to bypass non-ssl connections. We went through the Git Hub Issue https://github.com/zalando/postgres-operator/issues/1555 and could understand that the new versions of Spilo has override rather than append behavior. So we ended up having to place the entire pg_hba.conf file entries (got the values by spinning up a new cluster) to get the postgres working as before. Something like this

patroni:
    pg_hba:
      - host all all all md5
      - local   all             all                                   trust
      - hostssl all             +zalandos    127.0.0.1/32       pam
      - host    all             all                127.0.0.1/32       md5
      - hostssl all             +zalandos    ::1/128            pam
      - host    all             all                ::1/128            md5
      - local   replication     standby                    trust
      - hostssl replication     standby all                md5
      - hostnossl all           all                all                reject
      - hostssl all             +zalandos    all                pam
      - hostssl all             all                all                md5

So, my question is

Regards, Arun

Please, answer some short questions which should help us to understand your problem / question better?

Some general remarks when posting a bug report:

FxKu commented 2 years ago
  1. yes
  2. zalandos group role is for oauth authentication by Zalando employees. Changes would be harmless for you.
  3. Not via the manifest. You could patch Spilo and use a custom image so that you don't have to specify anything in the manifest.