Menu

Kubernetes Liveness & Readiness Probe Failed: Fix Restarts & 502s
📰

Kubernetes Liveness & Readiness Probe Failed: Fix Restarts & 502s

DEV Community: kubernetes·kkkevin·about 7 hours ago
#daZKnb6U
Long article (257 words) — no AI summary yet.
Reading 0:00
15s threshold

Misconfigured health probes are one of the top self-inflicted outage causes in Kubernetes: a failing readinessProbe removes your Pod from Service endpoints (causing 502 / 503 errors), while a failing livenessProbe kills and restarts your container—often triggering CrashLoopBackOff .

30-Second kubectl Diagnosis

# 1. Check exact probe HTTP status / timeout error kubectl describe pod -n | grep -iE "Unhealthy|probe|Warning"

# 2. Test the health endpoint directly from inside the Pod kubectl exec -it -n -- curl -i http://127.0.0.1:8080/healthz

Enter fullscreen mode

Exit fullscreen mode

4 Golden Rules for Production Probes

Always Add a startupProbe for Slow-Starting Apps (Java / Spring / ML): Never inflate initialDelaySeconds blindly; use startupProbe so liveness checks only begin after the app is actually listening.

Never Check External Databases Inside livenessProbe : If your database blips for 10 seconds and your livenessProbe fails, Kubernetes will restart every single API Pod at once—turning a minor DB…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.