Kubernetes Health Probes Configuration
Advancedv1.0.0
Configure liveness, readiness, and startup probes to ensure Kubernetes automatically detects and recovers from application failures, manages traffic routing, and handles slow-starting containers.
Content
Overview
Kubernetes uses three types of probes to monitor container health: liveness (restart if dead), readiness (route traffic only when ready), and startup (wait for slow starts). Proper probe configuration is the difference between a self-healing cluster and cascading failures.
Why This Matters
- -Self-healing — Kubernetes automatically restarts unhealthy containers
- -Zero-downtime deploys — traffic only routes to ready pods
- -Graceful degradation — temporarily remove overloaded pods from the load balancer
- -Slow startup handling — prevent liveness probe from killing slow-starting apps
The Three Probes
Liveness Probe
Readiness Probe
Startup Probe
Complete Example
Probe Types
Best Practices
- -Always use all three probes for production workloads
- -Liveness endpoint should check only the process, not dependencies
- -Readiness endpoint should check dependencies (database, cache)
- -Use startup probe for apps that take > 10 seconds to initialize
- -Set timeouts shorter than intervals
- -Readiness failureThreshold lower than liveness (remove from LB before restart)
Common Mistakes
- -Making liveness probe check database connectivity (causes restart cascades)
- -Setting initialDelaySeconds too low (kills containers during startup)
- -Not using startup probe for slow apps (liveness kills them before ready)
- -Using the same endpoint for liveness and readiness (different concerns)
FAQ
Discussion
Loading comments...