Liveness & Readiness ProbesIntermediate
1Question 1 of 1
yamlWhat is the difference between Liveness, Readiness, and Startup Probes in Kubernetes?
Explanation & Concept
• **Liveness Probe**: Detects if the container crashed or deadlocked. If it fails, Kubernetes restarts the container. • **Readiness Probe**: Detects if the container is ready to accept user traffic. If it fails, the Pod's IP is removed from Service endpoints so no traffic is routed to it. • **Startup Probe**: Disables liveness and readiness checks until slow-starting applications have finished initial startup.
Code Example
yaml
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 8080
periodSeconds: 5How It Works & Key Takeaways
A failing readiness probe protects users from 502 Bad Gateway errors while warm-up caches or database connections are being established.
Mock Test · 1 Questions · Optional
Ready for Horizontal Pod Autoscaler?
Take a quick test to evaluate yourself, or move straight to the next module.
Advanced1 questions