Skip to content

Probe Postgres readiness over TCP so the pod isn't ready before 5432 is open - #130

Merged
thomasjm merged 2 commits into
masterfrom
postgres-readiness-tcp
Aug 26, 2026
Merged

Probe Postgres readiness over TCP so the pod isn't ready before 5432 is open#130
thomasjm merged 2 commits into
masterfrom
postgres-readiness-tcp

Conversation

@thomasjm

@thomasjm thomasjm commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

The readinessProbe ran pg_isready -U <user> with no -h, so it probes the Unix socket. During initdb a temporary socket-only server answers that, so the pod can report ready while TCP 5432 is still closed — a caller that port-forwards and connects as soon as the pod is Ready gets connection refused.

-h 127.0.0.1 makes the probe check what callers actually connect to.

Untested locally: stack build here wanted to reinstall GHC 9.12.4 and failed.

@thomasjm
thomasjm force-pushed the postgres-readiness-tcp branch from 3f4d8db to 22a6b77 Compare August 26, 2026 02:06
@thomasjm
thomasjm changed the base branch from paralleln-lanes to master August 26, 2026 02:06
@thomasjm
thomasjm force-pushed the postgres-readiness-tcp branch from 22a6b77 to a6a0767 Compare August 26, 2026 02:48
@thomasjm
thomasjm merged commit 31ca425 into master Aug 26, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant