kubernetes
networking_error
ai_generated
partial
502 Bad Gateway (Ingress/Nginx)
ID: kubernetes/ingress-502-bad-gateway
80%Fix Rate
85%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
Ingress can't reach backend pods. Service misconfigured, pods not ready, or port mismatch.
genericWorkarounds
-
92% success Verify service selector matches pod labels: kubectl get ep <service>
kubectl get ep <service>
Sources: https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors
-
90% success Check pod readiness — unready pods are removed from endpoints
kubectl get pods -o wide kubectl describe endpoints <service-name>
Sources: https://kubernetes.io/docs/concepts/services-networking/service/
-
88% success Verify service port matches container port (not just pod port)
not just pod port
Sources: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
Dead Ends
Common approaches that don't work:
-
Increase proxy timeouts to very large values
65% fail
If pods are down, timeouts don't help
Error Chain
Frequently confused with: