Skip to content

Commit d15f2d3

Browse files
authored
Readiness probe (zalando#1169)
Right now there are no readiness probes defined for connection pooler, which means after a pod restart there is a short time window (between a container start and connection pooler starting listening to a socket) when a service can send queries to a new pod, but connection will be refused. The pooler container is rather lightweight and it start to listen immediately, so the time window is small, but still. To fix this add a readiness probe for tcp socket opened by connection pooler.
1 parent 692c721 commit d15f2d3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/cluster/k8sres.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,13 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(spec *acidv1.PostgresSpec)
22162216
},
22172217
},
22182218
Env: envVars,
2219+
ReadinessProbe: &v1.Probe{
2220+
Handler: v1.Handler{
2221+
TCPSocket: &v1.TCPSocketAction{
2222+
Port: intstr.IntOrString{IntVal: pgPort},
2223+
},
2224+
},
2225+
},
22192226
}
22202227

22212228
podTemplate := &v1.PodTemplateSpec{

0 commit comments

Comments
 (0)