Health Checks: Liveness, Readiness, and Startup Probes
Use Kubernetes probes to detect unhealthy containers, gate traffic until apps are ready, and give slow starters time to boot.
Health Checks: Liveness, Readiness, and Startup Probes is a free Docker & Kubernetes for Developers lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Docker & Kubernetes for Developers learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Probes Matter
Kubernetes cannot know your app is healthy just because the process is running. Probes let you tell the kubelet how to check real application health.
The Three Probe Types
There are three: liveness (restart if broken), readiness (gate traffic), and startup (protect slow boots).
Liveness Probe
If the liveness probe fails, the kubelet restarts the container. Use it to recover from deadlocks the process cannot detect itself.
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 10Readiness Probe
If readiness fails, the Pod is removed from Service endpoints but NOT restarted. This stops traffic to a Pod that is temporarily unable to serve.
readinessProbe:
httpGet:
path: /ready
port: 8080
periodSeconds: 5Liveness vs Readiness
Liveness answers should I restart this; readiness answers should I send traffic. Using readiness as liveness causes needless restarts; the opposite causes failed requests.
Startup Probe
A startup probe disables liveness and readiness until the app finishes booting, perfect for slow-starting legacy apps.
startupProbe:
httpGet:
path: /healthz
port: 8080
failureThreshold: 30
periodSeconds: 10Probe Mechanisms
Probes can use httpGet, a raw tcpSocket connection, or run a command with exec, succeeding when the command exits 0.
livenessProbe:
exec:
command: ["cat", "/tmp/healthy"]Tuning Timing
Key knobs: initialDelaySeconds, periodSeconds, timeoutSeconds, failureThreshold, and successThreshold let you balance speed of detection against false positives.
Probes and Rollouts
Readiness probes make rolling updates safe: new Pods only receive traffic once ready, so a broken release does not serve users.
Debugging Failing Probes
Probe failures show up in events. Describe the Pod to see why it restarts or never becomes ready.
kubectl describe pod my-podCommon Mistakes
Avoid heavy health endpoints that themselves cause timeouts, and avoid too-short initialDelaySeconds that restart Pods before they finish booting.
Quick Check
Test what you have learned.
Recap
You learned the three probe types: liveness restarts, readiness gates traffic, startup protects slow boots, the http/tcp/exec mechanisms, timing knobs, and how readiness keeps rollouts safe.
Frequently asked questions
Is the “Health Checks: Liveness, Readiness, and Startup Probes” lesson free?
Yes — the full text of “Health Checks: Liveness, Readiness, and Startup Probes” is free to read here on the web, and the Docker & Kubernetes for Developers course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Docker & Kubernetes for Developers course, upgrade to CoddyKit PRO.
What will I learn in “Health Checks: Liveness, Readiness, and Startup Probes”?
Use Kubernetes probes to detect unhealthy containers, gate traffic until apps are ready, and give slow starters time to boot. You practise Docker & Kubernetes for Developers with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Docker & Kubernetes for Developers?
No prior experience is required. Docker & Kubernetes for Developers on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Health Checks: Liveness, Readiness, and Startup Probes” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Docker & Kubernetes for Developers lesson?
Yes. Every Docker & Kubernetes for Developers lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Kubernetes Logging Strategies
- Monitoring with Prometheus & Grafana
- Troubleshooting Common K8s Issues
- Health Checks: Liveness, Readiness, and Startup Probes