Liveness probes restart crashed containers; Readiness probes remove unhealthy pods from load balancers.
Liveness, Readiness, Startup Probes
containers:
- name: myapp
image: myapp:1.0
# Restart pod if this fails
livenessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 10
periodSeconds: 30
failureThreshold: 3
# Remove from load balancer if this fails
readinessProbe:
httpGet:
path: /ready
port: 3000
initialDelaySeconds: 5
periodSeconds: 10
# Give slow-starting containers extra time
startupProbe:
httpGet:
path: /health
port: 3000
failureThreshold: 30 # 30 * 10s = 5 minutes max
periodSeconds: 10