fix: reduce startupProbe periodSeconds without losing failure tolerance (#992)

The startup probe for the injected plugin-barman-cloud sidecar
previously left `periodSeconds` unset, so the API server defaulted it to
10s. Because the sidecar is a native init container that gates the main
postgres container on reaching `Started`, this added roughly one full
period to every pod's startup, even though the probe itself (a local
unix-socket health check) normally succeeds in milliseconds.

`periodSeconds` is now 1s, so the probe reports success almost
immediately in the common case. To avoid trading away failure tolerance
for that faster common case, `failureThreshold` is raised to 30 and
`timeoutSeconds` is lowered to 5s: a unix-socket call essentially never
times out under mere load, so hitting the timeout means the sidecar is
genuinely unresponsive rather than just slow, and it's fine to give that
rare case more attempts before restarting the container.

Closes #991

Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
This commit is contained in:
Niccolò Fei 2026-07-09 10:36:09 +02:00 committed by GitHub
parent 3cc6a882c8
commit bf955430cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -403,8 +403,9 @@ func reconcilePodSpec(
envs = append(envs, config.env...) envs = append(envs, config.env...)
baseProbe := &corev1.Probe{ baseProbe := &corev1.Probe{
FailureThreshold: 10, PeriodSeconds: 1,
TimeoutSeconds: 10, FailureThreshold: 30,
TimeoutSeconds: 5,
ProbeHandler: corev1.ProbeHandler{ ProbeHandler: corev1.ProbeHandler{
Exec: &corev1.ExecAction{ Exec: &corev1.ExecAction{
Command: []string{"/manager", "healthcheck", "unix"}, Command: []string{"/manager", "healthcheck", "unix"},