$30 off During Our Annual Pro Sale. View Details »

Kubernetes Pod Probes

Tim Hockin
January 17, 2023

Kubernetes Pod Probes

I am a visual-thinker, so it helps me to have diagrams!

Tim Hockin

January 17, 2023
Tweet

More Decks by Tim Hockin

Other Decks in Technology

Transcript

  1. // 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 // ... }
  2. 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
  3. 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)
  4. 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