AlgoViz

Kubernetes readiness and restart loops

medium 6 min

A startup probe can protect slow initialization by delaying normal liveness and readiness checks until startup succeeds.

Video lesson · Chapter 1 of 4

A slow start becomes a restart loop

0:00 / 2:19

Theory

Read or listen first. About 1 min.

What it is

A startup probe can protect slow initialization by delaying normal liveness and readiness checks until startup succeeds. Readiness controls endpoint eligibility. A failed liveness check can restart a container. If an external dependency fails, restarting every otherwise healthy caller can amplify the disruption.

Why it exists

A larger cache takes longer to warm than the existing liveness allowance. New pods restart before they ever become ready, and the remaining ready replicas overload. Inspect restart reason, probe failures, last termination state and rollout history. Give bounded startup time, keep readiness tied to serving ability and reserve liveness for failures that a restart can repair.

If the last termination was an OOM kill, changing a probe allowance will not fix the exhausted memory budget.

A slow start becomes a restart loop

Kubelet → Startup probe (check startup). Startup probe → Readiness probe (enable after success). Readiness probe → Service endpoints (ready for traffic)
Kubelet → Startup probe (check startup). Startup probe → Readiness probe (enable after success). Readiness probe → Service endpoints (ready for traffic)

How it works

Step through the idea, or press Play.

Step 1 of 3

Baseline. All six replicas serve traffic.

Understand it

Worked incident

A slow start becomes a restart loop

ObservationReady replicas out of six (replicas)Interpretation
Baseline6All six replicas serve traffic.
Incident1Five new replicas restart during initialization and never join endpoints.
After intervention6Introduce a measured startup allowance and verify cold-start readiness under a rolling deployment.
Illustrative measurements from the same workload at three checkpoints.

Choose the next investigation

If the last termination was an OOM kill, changing a probe allowance will not fix the exhausted memory budget.

Summary

The whole topic in one minute.

A liveness failure can restart useful initialization. Readiness controls whether an instance receives traffic.

If the last termination was an OOM kill, changing a probe allowance will not fix the exhausted memory budget.

Sources