Ingress returns 404/502 — backend service unresolved
curl to the Ingress host returns 404 Not Found or 502
Focused incident mode — strips away everything but this runbook.
Symptoms
- curl to the Ingress host returns 404 Not Found or 502
- Ingress controller logs: 'no service in kubernetes.io/ingress class' or 'backend not found'
- LoadBalancer IP responds but route fails
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
Ingress backend ref
kubectl get ingress <name> -n <namespace> -o yaml | grep -A5 backendsIngress controller logs
kubectl logs -n ingress-nginx -l app.kubernetes.io/name=ingress-nginx --tail=100
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- Ingress says service 'api' but the Service is named 'api-v2'
- Controller logs 'service ... not found'
Confirm before fixing
kubectl get svc -n <namespace>List real Service names/ports
Fix
kubectl edit ingress <name> -n <namespace>Point the backend at the correct name/port
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
curl -I http://<ingress-host>/<path>Capture the failing status
Expected: HTTP/1.1 404 or 502
kubectl get svc,ingress,endpoints -n <namespace>Compare the whole chain
kubectl logs -n ingress-nginx -l app.kubernetes.io/name=ingress-nginx --tail=100Read the controller's decision on the request
Prevention
- Generate Ingress from a manifest template so names/ports stay in sync.
- Add a post-deploy smoke test on the Ingress host.
- Follow service-no-endpoints checks as part of Ingress deploys.
Related runbooks
Same stack, same failure family — worth a skim.
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.