K8s by Example: Readiness Probes
| Readiness probes control when a Pod receives traffic. If the probe fails, the Pod is removed from Service endpoints (no restart). Use for: warmup, cache loading, dependency checks, load shedding. |
| pod-readiness.yaml | |
| Readiness probes use the same syntax as liveness probes. The key difference is what happens on failure: readiness removes from endpoints, liveness restarts the container. | |
| pod-both-probes.yaml | |
| Readiness vs Liveness: Liveness restarts broken containers. Readiness removes from Service endpoints (Pod keeps running). A Pod can be “alive” but “not ready”, for example when warming up caches. Use different endpoints: | |
| deployment-readiness.yaml | |
| During rolling updates, readiness gates traffic flow. New Pods don’t receive traffic until ready. Old Pods keep serving until enough new ones are ready (controlled by maxUnavailable). | |
| pod-readiness-deps.yaml | |
| Check dependencies in readiness probe. Pod becomes not ready if database or cache is unavailable. This enables load shedding when downstream services fail. | |
| pod-readiness-threshold.yaml | |
|
| |
| pod-readiness-gates.yaml | |
| ReadinessGates add custom conditions for Pod readiness beyond probes. External controllers set these conditions. Pod isn’t ready until all gates are True. Useful for custom validation. | |
| terminal | |
| Debug readiness issues by checking endpoints. If a Pod is running but not in endpoints, readiness is failing. Check probe path and verify the application responds correctly. | |