Liveness, Readiness & Startup Probes
Configure probes so Kubernetes restarts unhealthy containers and routes only ready pods.
In plain words
Readiness is a restaurant hostess deciding when to seat guests, liveness is the fire alarm, and startup is the grace period while the kitchen turns on. The simple Kubernetes rule is: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
Think of it like…
Readiness is a restaurant hostess deciding when to seat guests, liveness is the fire alarm, and startup is the grace period while the kitchen turns on.
Where you’ve seen it
A cluster operator validates a small change and runs kubectl describe pod api-0; kubectl get endpoints api -o yaml. Expected evidence: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy. If the run instead shows this symptom, stop and restore the last known state: A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts.
Words you’ll hear
- Liveness
- For this lesson, Liveness is the controlling idea: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
- Readiness
- Readiness is the checkpoint; run
kubectl describe pod api-0; kubectl get endpoints api -o yamland inspect the owner chain. A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts. - Startup
- Startup is the outcome to preserve; the cost is explicit: Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity.
- Verification evidence
- The evidence command is
kubectl describe pod api-0; kubectl get endpoints api -o yaml. It connects the declaration to this behavior: Configure probes so Kubernetes restarts unhealthy containers and routes only ready pods.
Visual diagram
Theory & deep dive
How Liveness reaches the intended state
Configure probes so Kubernetes restarts unhealthy containers and routes only ready pods. Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
The concrete checkpoint is kubectl describe pod api-0; kubectl get endpoints api -o yaml; compare the Liveness owner, Readiness state, and Startup outcome instead of treating YAML acceptance as proof.
Run kubectl describe pod api-0; kubectl get endpoints api -o yaml after the change and correlate the result with Events and the owning object. Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
Readiness: failure boundary and production cost
A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts. The prerequisite contract is concrete: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity. A safe design limits blast radius, records the last good configuration, and uses kubectl describe pod api-0; kubectl get endpoints api -o yaml as a deterministic rollback checkpoint.
Capture the current state with kubectl describe pod api-0; kubectl get endpoints api -o yaml, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts.
How it works, step by step
Step 1 of 41. Model the cluster contract
Start from a minimal API, context, or node condition and make this contract explicit: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
- Goal
- Configure probes so Kubernetes restarts unhealthy containers and routes only ready pods.
- Owner
- Liveness
When to use it & trade-offs
What it is
Configure probes so Kubernetes restarts unhealthy containers and routes only ready pods. Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
Why it matters: A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts. The invariant at risk is specific: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy. The quickest fact check before changing the design is kubectl describe pod api-0; kubectl get endpoints api -o yaml.
When to reach for it
- Use Liveness to enforce this invariant: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
- Use Readiness evidence from
kubectl describe pod api-0; kubectl get endpoints api -o yamlin reviews and incident timelines. Configure probes so Kubernetes restarts unhealthy containers and routes only ready pods. - Choose the platform-level abstraction route only when this cost is justified by governance or scale: Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity.
When to avoid or be careful
- Avoid assuming Liveness is complete after YAML submission; the required behavior is concrete: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
- Avoid treating the next symptom as random; check the owner and state with
kubectl describe pod api-0; kubectl get endpoints api -o yamlfirst: A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts. - Avoid adopting a heavier platform wrapper before measuring its cost: Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity.
Native, manual, and managed paths for Liveness
kubectl describe pod api-0; kubectl get endpoints api -o yaml.Strengths: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
Watch out: Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity. Recovery must also recognize this signal: A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts.
kubectl describe pod api-0; kubectl get endpoints api -o yaml; the expected invariant is: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.Strengths: kubectl describe pod api-0; kubectl get endpoints api -o yaml gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike Liveness, it does not make this symptom self-documenting: A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts.
kubectl describe pod api-0; kubectl get endpoints api -o yaml.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
Watch out: The added platform ownership buys value at this cost: Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
- Trace Liveness to Startup through Readiness; the invariant is: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
- Recognize the symptom: A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts.
- Justify the cost: Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity.
- Verify with kubectl describe pod api-0; kubectl get endpoints api -o yaml instead of only inspecting YAML.
Benchmarks & rules of thumb
- 3
- probe kinds: startup, readiness, and liveness
- 3
- default failureThreshold for probe definitions
- 10s
- default probe period unless the workload overrides it
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the Liveness owner contract: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy.
- Ignoring this telltale condition leads to unrelated changes: A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts.
- Repeating
kubectl describe pod api-0; kubectl get endpoints api -o yamlwithout an owner for remediation wastes retry cost. Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy?
- Which owner object, logs, and Events would you inspect for this symptom-A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts-?
- At what threshold would this cost become unacceptable: Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity?
kubectl describe pod api-0; kubectl get endpoints api -o yaml, name the failure, then justify the cost. Invariant: Readiness removes a Pod from Service endpoints, liveness restarts a stuck container, and startup suppresses the other two until a slow-starting process has had time to become healthy. Failure: A liveness dependency check can restart an otherwise healthy app during a downstream outage, while a missing startup probe can kill a JVM or migration-heavy process before it starts. Cost: Probes make traffic and recovery automatic, but over-aggressive thresholds create cascades and probe endpoints consume application capacity.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Liveness, Readiness & Startup Probes with generative AI interview Q&A and hands-on practice.