Kubernetes Health Check: timeoutSeconds exceeds periodSeconds

3/18/2021

In Kubernetes Kubernetes Health Check Probes, what happens if timeoutSeconds exceeds periodSeconds? For example:

initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3

When will the Pod "fail"?

  • initialDelaySeconds + (periodSeconds * failureThreshold); or
  • initialDelaySeconds + ( MAX(periodSeconds,timeoutSeconds) * failureThreshold);

Same question applies for when the Pod succeeds.

-- h q
kubernetes
kubernetes-health-check
livenessprobe
readinessprobe

1 Answer

3/18/2021

There is a diagram in this blog post which illustrate your question clearly:

Probe Timeline

The pod will be restarted at lowest,

time = initialDelay + (failureThreshold - 1) * period + timeout

  • timeoutSeconds > periodSeconds ?

The probe call will be fired at a given interval independent of the previous probe response. The failureThreshold will be checked, once the probe call is passed or failed/timeout. But it is recommended to use periodSeconds greater than the timeoutSeconds.

-- Kamol Hasan
Source: StackOverflow