teluzia.Cloud Engineer · Day 117
CHAPTER 17 · KUBERNETES FUNDAMENTALS

Readiness/liveness probes

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

Readiness asks whether a worker should receive customers; liveness asks whether the worker needs restarting; startup gives training time before those checks begin. Readiness determines whether a Pod should receive normal Service traffic. A failing readiness probe does not itself restart the container. Select a meaningful endpoint and suitable thresholds so dependency behavior does not make every replica leave service unnecessarily at once. Liveness detects a condition for which restarting the container is a useful recovery action. An overly aggressive probe can create restart loops and worsen overload. Do not make every remote dependency failure a liveness failure if restarting cannot repair that dependency.

Think of it this way

Readiness asks whether a worker should receive customers; liveness asks whether the worker needs restarting; startup gives training time before those checks begin.

TOPIC 01 / 03Step by step

Readiness and endpoint membership

Readiness determines whether a Pod should receive normal Service traffic. A failing readiness probe does not itself restart the container. Select a meaningful endpoint and suitable thresholds so dependency behavior does not make every replica leave service unnecessarily at once. For example, an unready Pod can remain Running while it is removed from ready Service endpoints.

WORKED EXAMPLE
An unready Pod can remain Running while it is removed from ready Service endpoints.

A Pod's process is running but still warming its cache. Its readiness probe fails, so ordinary ready endpoint selection excludes it from Service traffic. Other ready replicas can continue receiving requests. When the probe succeeds, the Pod becomes eligible and the Service's endpoint information reflects that change through reconciliation. Readiness failure alone does not restart the process.

Readiness is traffic eligibility. An endpoint is a backend destination represented for service routing. A probe is a repeated check with configured timing and success criteria. Choose a check tied to the decision: can this instance accept useful requests now? If every replica marks itself unready during a shared dependency outage, the Service may have no ready backends. That may be appropriate or unnecessarily severe depending on behavior. Avoid turning transient unrelated failures into blanket traffic removal. Observe readiness conditions and EndpointSlices rather than infer routing solely from Running status.

Why this matters

An unready Pod can remain Running while it is removed from ready Service endpoints.

A common trap

Do not overlook this operational distinction: Select a meaningful endpoint and suitable thresholds so dependency behavior does not make every replica leave service unnecessarily at once.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Readiness and endpoint membership

Readiness determines whether a Pod should receive normal Service traffic. A failing readiness probe does not itself restart the container. Select a meaningful endpoint and suitable thresholds so dependency behavior does not make every replica leave service unnecessarily at once. For example, an unready Pod can remain Running while it is removed from ready Service endpoints.

WORKED EXAMPLE
An unready Pod can remain Running while it is removed from ready Service endpoints.

A Pod's process is running but still warming its cache. Its readiness probe fails, so ordinary ready endpoint selection excludes it from Service traffic. Other ready replicas can continue receiving requests. When the probe succeeds, the Pod becomes eligible and the Service's endpoint information reflects that change through reconciliation. Readiness failure alone does not restart the process.

Readiness is traffic eligibility. An endpoint is a backend destination represented for service routing. A probe is a repeated check with configured timing and success criteria. Choose a check tied to the decision: can this instance accept useful requests now? If every replica marks itself unready during a shared dependency outage, the Service may have no ready backends. That may be appropriate or unnecessarily severe depending on behavior. Avoid turning transient unrelated failures into blanket traffic removal. Observe readiness conditions and EndpointSlices rather than infer routing solely from Running status.

Why this matters

An unready Pod can remain Running while it is removed from ready Service endpoints.

A common trap

Do not overlook this operational distinction: Select a meaningful endpoint and suitable thresholds so dependency behavior does not make every replica leave service unnecessarily at once.

Liveness and restart behavior

Liveness detects a condition for which restarting the container is a useful recovery action. An overly aggressive probe can create restart loops and worsen overload. Do not make every remote dependency failure a liveness failure if restarting cannot repair that dependency. For example, a process deadlock may justify liveness failure; a temporary database outage may instead require request errors and retry handling.

WORKED EXAMPLE
A process deadlock may justify liveness failure; a temporary database outage may instead require request errors and retry handling.

A process enters a deadlock and stops answering its local diagnostic endpoint. After the configured number of liveness failures, the node restarts the container according to applicable lifecycle behavior. This can recover a process-local fault. If the failure is an unavailable remote database, restarting every instance may not repair anything and can increase load during the outage.

Liveness asks whether restarting this container is useful. Failure threshold controls repeated failure tolerance. Restart count provides evidence of recovery attempts. A probe timeout shorter than normal overloaded response time can cause restart loops precisely when capacity is scarce. Separate meaningful local failure detection from downstream availability. Startup and readiness checks address different decisions, so one shared endpoint is not automatically suitable for all three. Review process behavior and actual timing, then test a safe fault in a local environment. A container that restarts repeatedly may appear briefly Running while never providing stable useful service.

Why this matters

A process deadlock may justify liveness failure; a temporary database outage may instead require request errors and retry handling.

A common trap

Do not overlook this operational distinction: Do not make every remote dependency failure a liveness failure if restarting cannot repair that dependency.

Startup timing and probe design

A startup probe protects slow-starting applications by delaying liveness and readiness probing until startup succeeds. Probe interval, timeout, and thresholds define the allowed window. Account for real startup measurements and use endpoints that reflect the particular recovery or traffic decision each probe controls. For example, a five-second interval with failureThreshold 12 gives approximately a sixty-second startup allowance, subject to other timing details.

WORKED EXAMPLE
A five-second interval with failureThreshold 12 gives approximately a sixty-second startup allowance, subject to other timing details.

A model-serving application needs roughly seventy seconds to load its data. Ordinary liveness checks starting too early might restart it before initialization finishes. A startup probe allows a configured startup window; while it has not succeeded, the other probes are suppressed according to Kubernetes behavior. After success, ongoing readiness and liveness perform their separate jobs.

A startup probe detects completion of initialization. Period is the interval between checks. Failure threshold and timing settings shape the allowed startup window. Calculate from measured worst-case startup, accounting for timeout and scheduling details rather than a single optimistic launch. An excessive window delays detecting a genuinely failed startup; an insufficient window creates a loop. Startup success does not promise later health, and readiness success does not prove every business operation. Record expected initialization, response, and recovery behavior so the three probes reflect deliberate control decisions instead of copied constants.

Why this matters

A five-second interval with failureThreshold 12 gives approximately a sixty-second startup allowance, subject to other timing details.

A common trap

Do not overlook this operational distinction: Account for real startup measurements and use endpoints that reflect the particular recovery or traffic decision each probe controls.

KEEP THESE WITH YOU

Today’s takeaways

Readiness and endpoint membership: Readiness determines whether a Pod should receive normal Service traffic. A failing readiness probe does not itself restart the container. Select a meaningful endpoint and suitable thresholds so dependency behavior does not make every replica leave service unnecessarily at once.

Liveness and restart behavior: Liveness detects a condition for which restarting the container is a useful recovery action. An overly aggressive probe can create restart loops and worsen overload. Do not make every remote dependency failure a liveness failure if restarting cannot repair that dependency.

Startup timing and probe design: A startup probe protects slow-starting applications by delaying liveness and readiness probing until startup succeeds. Probe interval, timeout, and thresholds define the allowed window. Account for real startup measurements and use endpoints that reflect the particular recovery or traffic decision each probe controls.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed