Back to blog
Kubernetes1 min readDEC 16, 2024

A practical guide to Kubernetes probes

What liveness, readiness, and startup probes actually control, and the failure modes of getting them wrong.

The three probe types answer three different questions, and using one to answer another question is how a healthy deployment turns into a restart loop.

What each probe controls

  • Startup: has the process finished booting? Suspends the other probes while it runs.
  • Readiness: should this pod receive traffic right now?
  • Liveness: is this process unrecoverable and worth restarting?

The common failure

Pointing liveness at a handler that checks dependencies. When the database slows down, every pod fails liveness, restarts simultaneously, and turns a degraded dependency into a full outage.

Sensible defaults

startupProbe:
  httpGet: { path: /healthz, port: 8080 }
  failureThreshold: 30
  periodSeconds: 2
readinessProbe:
  httpGet: { path: /readyz, port: 8080 }
  periodSeconds: 5
livenessProbe:
  httpGet: { path: /healthz, port: 8080 }
  periodSeconds: 10
  failureThreshold: 3

Tune the startup threshold to your slowest cold start, and leave liveness generous. Restarting is the most destructive action the platform can take on your behalf.

Topics

kubernetesreliability