Pcornel
Containers · Scheduling, Resources & Health

Liveness, Readiness and Startup Probes

Cheat sheet · https://pcornel.dk/topic.php?topic=6154

Back to the Topic

Answer

Probes report container health: liveness (restart if failing), readiness (remove from Service endpoints if failing) and startup (delay other probes while starting).

Remember

Liveness should check only the process itself, not dependencies — otherwise outages cascade. Use startupProbe for slow starts. Readiness controls traffic during rollouts.

First checks

  • kubectl exec <p> -- wget -qO- localhost:<port>/health — first check for this topic
  • kubectl get pods -o wide — pods, status, node, IP
  • kubectl describe pod <pod> — events and conditions
  • kubectl logs <pod> [-c <c>] [--previous] — container logs (incl. previous crash)
  • kubectl get events --sort-by=.lastTimestamp — recent cluster events

Verify in this order

kubelet runs probes → readiness gates endpoints → liveness restarts

Where it usually breaks

A liveness probe that checks the database restarts every Pod when the database is slow.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6154

Confirmation

Confirm action

Continue?