Readiness probe failing, container perfectly healthy: the probe path your app never routes
Problem
Deployments rolled out, pods restarted, and the service sent them zero traffic:
Readiness probe failed: HTTP probe failed with statuscode: 404
Pod "app-7d9c6b5f4-xqz2l" never became ready; endpoints removed from serviceThe app was demonstrably fine — kubectl exec ... curl localhost:3000/api/health returned 200. The probe said 404. Both were telling the truth.
Root cause
The probe was checking /health; the app routes /api/health. A 404 means kubelet reached the app and the app said "no such route" — networking is fine, the path is wrong. The two other failure shapes are worth distinguishing because the fixes differ:
- Probe timeout (not 404): the endpoint exists but does work — DB queries, dependency calls — and exceeds
timeoutSeconds. - Connection refused during startup: app not listening yet; that is
initialDelaySecondsor, better, a startupProbe.
Readiness also answers a different question than people assume: "should this pod receive traffic right now", not "is the app healthy". An endpoint that checks dependencies (DB) makes one slow query mark every pod unready simultaneously — a self-inflicted outage during DB lag.
// express/hono/fastify — a readiness endpoint that does NOT touch dependencies
… 1 more line in the fix🔒 the fix — including 3 code blocks — is members-only. $1/mo unlocks everything.