Kubernetes readiness and restart loops
medium 6 minA 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
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
How it works
Step through the idea, or press Play.
Baseline. All six replicas serve traffic.
Understand it
Worked incident
A slow start becomes a restart loop
| Observation | Ready replicas out of six (replicas) | Interpretation |
|---|---|---|
| Baseline | 6 | All six replicas serve traffic. |
| Incident | 1 | Five new replicas restart during initialization and never join endpoints. |
| After intervention | 6 | Introduce a measured startup allowance and verify cold-start readiness under a rolling deployment. |
Choose the next investigation
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.