# patroni.dynamicConfiguration with pg\_hba settings

**URL:** <https://forums.percona.com/t/patroni-dynamicconfiguration-with-pg-hba-settings/23870>\
**Category:** PostgreSQL\
**Tags:** percona, kubernetes\
**Created:** [July 24, 2023, 7:17pm UTC](https://forums.percona.com/t/patroni-dynamicconfiguration-with-pg-hba-settings/23870 "2023-07-24T19:17:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshay1988](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Akshay1988](https://forums.percona.com/u/Akshay1988)\
**Post date:** [July 24, 2023, 7:17pm UTC](https://forums.percona.com/t/patroni-dynamicconfiguration-with-pg-hba-settings/23870/1 "2023-07-24T19:17:58Z")

</div>

Hi Team,

How can I overwrite pg\_hba configuration for patroni? I don’t see any parameter available in this document: [Custom Resource options - Percona Operator for PostgreSQL](https://docs.percona.com/percona-operator-for-postgresql/2.0/operator.html#proxypgbouncersidecars-subsection)

I have installed this operator in kubernatese cluster however my backend pod which have connection string is failing to connect and giving error "28000: no pg\_hba.conf entry for host “x.x.x.x”, user “xyz”, database “xyz”, no encryption.

Is available and we can just go ahead and add it?

---

<div class="post-metadata">

**Author:** ![lalit.choudhary](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lalit.choudhary/32/51_2.png) [@lalit.choudhary](https://forums.percona.com/u/lalit.choudhary)\
**Post date:** [July 26, 2023, 7:05am UTC](https://forums.percona.com/t/patroni-dynamicconfiguration-with-pg-hba-settings/23870/2 "2023-07-26T07:05:32Z")

</div>

K8 Postgresql Operator use configmap and you can view and edit pg config + pg\_hba.conf using below commands,

Example:

```auto
$ kubectl get cm -n pgo
NAME DATA AGE
kube-root-ca.crt 1 23h
pgo-deployer-cm 1 23h
pgo-config 40 23h
cluster1-sat-night-backup 1 23h
cluster1-config 0 22h
cluster1-pgbouncer-cm 2 22h
testcm 1 19h
cluster1-pgha-config 5 23h
cluster1-leader 0 22h

```

## view pgha-config

$ kubectl describe cm cluster1-pgha-config -n pgo

## Edit/update pgha-config

$ kubectl edit cm cluster1-pgha-config

---

<div class="post-metadata">

**Author:** ![Jobin\_Augustine](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jobin_augustine/32/1275_2.png) [@Jobin\_Augustine](https://forums.percona.com/u/Jobin_Augustine)\
**Post date:** [February 12, 2025, 1:01pm UTC](https://forums.percona.com/t/patroni-dynamicconfiguration-with-pg-hba-settings/23870/3 "2025-02-12T13:01:06Z")

</div>

Hi Akshey,  
Here is how you can specify pg\_hba rules in CR.

```auto
  patroni:
    dynamicConfiguration:
      postgresql:
        parameters:
          max_parallel_workers: 2
          work_mem: 2MB
        pg_hba:
        - local all all trust
        - host all all 0.0.0.0/0 md5
        - host all all ::1/128 md5

```

Just an example. But I hope this helps.  
Regards,  
Jobin
