Line order v2.2 pg_hba.conf

Description:

How to rewrite pg_hba.conf completely in v2.2 or insert lines at the beginning?

When using the corresponding section in the cr.yaml, the lines are added to the end of those that are already set by default.

Steps to Reproduce:

  patroni:
    dynamicConfiguration:
      postgresql:
        parameters:
          shared_preload_libraries: pg_cron,pg_stat_monitor,pgaudit,pg_stat_statements
          krb_server_keyfile: postgres.keytab
          cron.database_name: postgres
          track_io_timing: on
         
        pg_hba:                                                                                                                                     
        - local all postgres trust

Version:

v2.2

2 Likes

I’m running into the same issue, lines are appended to the end of the file, whilst the file has a top down approach…making it not possible to secure access through this pg_hba.conf file.
I’m curious to the solution or workaround @Sergey_Zhuravlev.

1 Like

To the best of my knowledge
Currently, this is not possible because the operator manages the first entries by default.
But this might be implemented in future because there is a JIRA item existing.
https://perconadev.atlassian.net/browse/K8SPG-712

2 Likes