Running workloadsLesson 1 of 14
Health checks — alive, and ready for requests?
A running container does not guarantee that the application works. Here we follow what the kubelet asks with three periodic checks (probes), and what it does with each answer. How a dead container comes back is covered in When a Pod Dies (Self-Healing).
web-b READY0/1
Pods taking requests1 (web-a)
web-b restarts0
RequestResponse / report
What you will learn
- Why Running and Ready are different
- Why the startup probe holds back the other probes
- A readiness failure removes the pod from the list, not restarts it
- A liveness failure restarts the container
- Two ways a bad probe setup causes restart loops
Probe mistakes and their results
| Probe | Common mistake | Result | Fix |
|---|---|---|---|
| liveness | Also checks the DB connection | When the DB slows briefly, all pods restart at once | Check only that the process is alive |
| liveness | Initial delay shorter than startup time | Restarts before ready, ending in CrashLoopBackOff | Add a startup probe or raise the delay |
| readiness | Not set at all | Requests reach new pods before they are ready, causing errors on every update | Expose an endpoint that reports readiness |
| readiness | Always returns success | Takes requests even when a dependency is down, returning errors to users | Check needed dependencies here |
| startup | Missing on a slow-starting app | Liveness fails first and restarts it mid-start | Allow the maximum startup time |
Try it yourself
kubectl get pods # READY (readiness) vs RESTARTS (liveness)
kubectl describe pod <pod> # Liveness/Readiness/Startup settings
kubectl get events --field-selector reason=Unhealthy # Probe failed messages
kubectl get endpointslices -l kubernetes.io/service-name=<service> # Is the pod in the list?
Check yourself
Further reading: Configure liveness, readiness and startup probes · Pod lifecycle — container probes · When a Pod Dies (Self-Healing) · How a Request Reaches a Pod