World map

 

BM: Baca dalam Bahasa Melayu

World K2: Trays & Orders

Liveness, readiness and startup probes

You will learn: how Kubernetes checks that your app is awake, ready and started.

Checked with Kubernetes 1.37 on 31 Oct 2026

The problem

A cook dozes off at the stove. The stall still looks open, so orders keep coming. Nothing gets cooked. How would the manager know?

Pick one answer.

Try it

Kubernetes asks each container up to three questions. Each question is a probe. Sort what each one does.

Drag a card into a box. Or tap the card, then tap the box.

        Watch

        You are here: cluster kind-dev namespace default
        sleepy asks nginx for /healthz, which does not exist. After 3 failed checks the container is restarted: RESTARTS goes up and the event says it failed its liveness probe. Terminal output: $ kubectl apply -f sleepy.yaml pod/sleepy created $ sleep 30 $ kubectl get pod sleepy NAME READY STATUS RESTARTS AGE sleepy 1/1 Running 1 (9s ago) 30s $ kubectl get events --field-selector reason=Killing -o jsonpath={.items[0].message} Container web failed liveness probe, will be restarted

        A liveness probe: "Is the cook still awake?" If it keeps failing, the kubelet restarts the container. asks: awake? sleepy checks /healthz, a page nginx does not have. Three 404s in a row: the kubelet restarts the container.

        Try it

        Press “App says not ready”. Watch the trays turn amber. Then run kubectl get pods: READY drops, RESTARTS stays 0.

        You are here: cluster kind-dev namespace default
        Stalls: 3. Trays: 3 (3 ready). Waiting for a stall: 0.
        • shop3/3 ready
        dev-control-planeOpenManager

        No trays here.

        dev-workerOpen
        • shop·75mv6
        • shop·zs9v2
        dev-worker2Open
        • shop·jg5l8
        Time: +0s (sped up)

        Predict

        All 3 shop trays fail readiness. What happens to customers who call the Service?

        Pick one answer.

        Try it

        A startup probe: "Still warming up?" Gives a slow app time to start before the other probes begin. gives a slow cook time. 30 tries, 10 seconds apart: up to 5 minutes. Liveness waits until it passes. Fix the typo.

        Fix the manifest, then press Apply.

        slow.yaml15 lines

        Check

        You are here: cluster kind-dev namespace default
        shy fails only its readiness probe: READY 0/1, STATUS Running, RESTARTS 0. Terminal output: $ kubectl apply -f shy.yaml pod/shy created $ sleep 20 $ kubectl get pod shy NAME READY STATUS RESTARTS AGE shy 0/1 Running 0 20s

        shy fails readiness only. READY 0/1, STATUS Running, RESTARTS 0. Not ready is not broken. It just gets no customers.

        You did it!

        You can now pick the right probe: awake, ready or warmed up.

        Go deeper (optional)

        A probe can be httpGet, tcpSocket, exec or grpc. Keep liveness about the app itself. If it checks the database, one slow database restarts every tray.

        Real rep (optional): on a throwaway cluster, apply sleepy.yaml and run kubectl describe pod sleepy. Read the Events.