Slide 1

Slide 1 text

Kubernetes Pod Probes @thockin Jan. 2023

Slide 2

Slide 2 text

NOTE: This documents logical behavior. The code may not actually be modelled this way.

Slide 3

Slide 3 text

// Probe describes a health check to be performed against a container to determine whether it is // alive or ready to receive traffic. type Probe struct { // ... // Number of seconds after the container has started before liveness probes are initiated. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes InitialDelaySeconds int32 // Number of seconds after which the probe times out. // Defaults to 1 second. Minimum value is 1. TimeoutSeconds int32 // How often (in seconds) to perform the probe. // Default to 10 seconds. Minimum value is 1. PeriodSeconds int32 // Minimum consecutive successes for the probe to be considered successful after having failed. // Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. SuccessThreshold int32 // Minimum consecutive failures for the probe to be considered failed after having succeeded. // Defaults to 3. Minimum value is 1. FailureThreshold int32 // ... }

Slide 4

Slide 4 text

startupProbe Waiting Probing Failing container start `initial Delay Seconds` `timeout Seconds` `failure Threshold` reached Passing fail pass `successThreshold` is required to be 1 for `startupProbe` restart container `period Seconds` Passed `success Threshold` reached continue `startupProbe` is done and will not be revisited unless the container restarts

Slide 5

Slide 5 text

livenessProbe Waiting Probing Failing `initial Delay Seconds` `timeout Seconds` `failure Threshold` reached Passing fail pass `successThreshold` is required to be 1 for `livenessProbe` restart container `period Seconds` `period Seconds` Passed `success Threshold` reached `livenessProbe` does not start until `startupProbe` completes (if defined)

Slide 6

Slide 6 text

readinessProbe Waiting Probing Failing `initial Delay Seconds` `timeout Seconds` `failure Threshold` reached Passing fail pass `period Seconds` `period Seconds` Ready Unready `period Seconds` `success Threshold` reached `period Seconds` `readinessProbe` does not start until `startupProbe` completes (if defined) `failureThreshold` is a consecutive count - any “pass” result resets the counter `successThreshold` is a consecutive count - any “fail” result resets the counter