Pcornel
Browse topics
Options
Recent
Favorites
Containers · Technical reference

Liveness, Readiness and Startup Probes

Direct answer

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

When to use this

Use it when pods restart repeatedly or are never Ready.

First 30 seconds

1. kubectl describe pod — probe failure events.

2. Probe path/port/command correct?

3. Timeouts and thresholds realistic?

4. Test the endpoint from inside: kubectl exec <p> -- wget -qO- localhost:<port>/health.

5. Adjust probes.

Operational verification

kubelet runs probes → readiness gates endpoints → liveness restarts

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Docker / containerd / Podman / Kubernetes / OCI-compatible platforms
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformDocker / containerd / Podman / Kubernetes / OCI-compatible platforms
Scope / prerequisiteUse it when pods restart repeatedly or are never Ready.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

Make the readiness endpoint check what the Pod needs to serve. Keep liveness simple so a slow dependency does not restart healthy Pods. Size startup probes to the slowest normal start.

Step 2 Common failures Narrow the fault

A liveness probe that checks the database restarts every Pod when the database is slow. A probe timeout of 1 second fails under load. Without a startup probe, slow starts are killed by liveness in a loop.

Key points

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

Key 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
ReferenceWhat it is1 section · depth on demand

How it works

The kubelet runs HTTP, TCP, gRPC or exec probes on a schedule (periodSeconds) with timeoutSeconds and failureThreshold. Readiness state is reported to the API and used by Services; liveness failures trigger a container restart.

ReferenceImportant terms & boundaries3 sections · depth on demand

Probe types

ProbeFailing means
startupProbeContainer still starting; other probes wait
readinessProbeRemove from Service endpoints (no restart)
livenessProbeRestart the container
readinessProbe: { httpGet: { path: /ready, port: 8000 }, periodSeconds: 5 }
livenessProbe:  { httpGet: { path: /healthz, port: 8000 }, initialDelaySeconds: 10, failureThreshold: 3 }

Documented example, not captured output. Liveness should not check dependencies (database), or a database outage restarts every Pod.

In depth

Timing arithmetic

A probe fails after failureThreshold × periodSeconds of consecutive failures. With the defaults (periodSeconds: 10, failureThreshold: 3, timeoutSeconds: 1) a liveness probe restarts a container about 30 seconds after it stops answering.

A startup probe allows failureThreshold × periodSeconds for start-up, for example 30 × 10 s = 5 minutes; liveness and readiness are not run until it succeeds once.

What each probe should check

ProbeShould checkShould not check
StartupApp finished initialising (migrations, cache warm-up)—
ReadinessCan serve requests now (including required local resources)Shared dependencies whose outage would empty every Pod at once
LivenessProcess is not stuck (deadlock, event loop hung)Databases or downstream APIs

Worked example

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

Reading probe failures

kubectl describe pod web-7c… | grep -A3 -E 'Liveness|Readiness|Unhealthy'
# Warning Unhealthy  Readiness probe failed: HTTP probe failed with statuscode: 503

Readiness failures remove the Pod from Service endpoints without restarting it; liveness failures show as restarts with Last State: Terminated, Reason: Error (or Completed) and exit code 137 or 143.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • Liveness probes that kill slow-starting apps (use startup probes).
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
liveness, readiness and startup probeskubernetes liveness readiness probestartup probe
Confirmation

Confirm action

Continue?