-
Notifications
You must be signed in to change notification settings - Fork 237
Description
Is your feature request related to a problem? Please describe.
I use pgcat pods for my Postgresql connection pooler in k8s. I deployed pgcat with helm using this repo. Since autoreloader not working correctly in k8s, I run 2 replicas of pgcat. Thus service will not be interrupted in case of config changes. But when I make tests I saw connection problems occurred during rollout of pods.
This is test query:
root@psql-client:/# PGPASSWORD=xxx bash -c 'while true; do echo -n "$(date "+%H:%M:%S") -> "; if ! psql -h pgcat-helm.pgcat.svc.cluster.local -p 6432 -U xxx -d xxx-t -c "SELECT now();" >/dev/null 2>&1; then echo "Connection error!"; else echo "OK"; fi; sleep 0.1; done'
When I run this test and make a rollout it gives connection error;
05:55:04 -> OK
05:55:04 -> OK
05:55:04 -> Connection error!
05:55:04 -> OK
05:55:05 -> OK
Describe the solution you'd like
I forked repo and changed deployment.yaml and added "initialDelaySeconds: 5" then it worked without error.
livenessProbe:
tcpSocket:
port: pgcat
initialDelaySeconds: 5
readinessProbe:
tcpSocket:
port: pgcat
initialDelaySeconds: 5
Describe alternatives you've considered
I will be glad to hear if anybody can run pgcat autoreloader in k8s.