Build · shipped
30 Days of Kubernetes (CKAD) — Day 04: Liveness, Readiness, and Startup Probes
Day 04 of the 30-day CKAD hands-on series: wiring honest health checks so Kubernetes routes traffic safely and self-heals deadlocked apps.
kubelet uses Probes to know when a container is ready for traffic and whether it is still alive.
1. The Three Probes
| Probe | When it fails | Purpose |
|---|---|---|
| Readiness | Pod is removed from Service Endpoints | Prevents sending user traffic during warmup or overload |
| Liveness | kubelet kills and restarts the container |
Recovers from deadlocks / hung processes |
| Startup | Blocks Liveness & Readiness until it succeeds | Protects slow-booting apps (e.g., JVM) from premature liveness kills |
2. Probe Mechanisms
httpGet: Checks HTTP status code200–399on a path & port.tcpSocket: Checks if a TCP handshake succeeds on a port.exec: Runs a command inside the container; exit code0means healthy.
3. Hands-On Lab: Day 04
In labs/k8s-30-days/day-04/:
- Create namespace
ckad-day04. - Deploy Pod
probed-nginx(nginx:1.27-alpine) with:readinessProbe:httpGet/on port80(initialDelaySeconds: 3,periodSeconds: 5).livenessProbe:tcpSocketon port80(initialDelaySeconds: 5,periodSeconds: 10).
- Verify with
./labs/k8s-30-days/day-04/verify.sh.