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
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?
K8 Postgresql Operator use configmap and you can view and edit pg config + pg_hba.conf using below commands,
Example:
$ 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
Hi Akshey,
Here is how you can specify pg_hba rules in CR.
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