ingress-nginx returns 404 for a new host. What do you check?
IntermediateScenarioServices, Ingress and DNS
Answer
Situation read → The Ingress object exists and has an address, but requests return the default backend 404.
What I'd do →
kubectl describe ingress appand check Rules and Events- Verify
ingressClassNamematches the controller class (kubectl get ingressclass) - Check the backend Service name, port and that it has endpoints
- Curl with the correct Host header, because a 404 usually means no matching host rule
kubectl -n ingress-nginx logs deploy/ingress-nginx-controllerfor config reload errors
Why → An Ingress with the wrong or missing class is simply ignored by the controller, and a Host mismatch falls through to the default backend.
Interview tip → Mention the removal of the old kubernetes.io/ingress.class annotation habit in favour of ingressClassName.
More on Services, Ingress and DNS
A Service has no endpoints. How do you find out why?BeginnerWhen do you use ClusterIP, NodePort, LoadBalancer and ExternalName?BeginnerTraffic to a Service works from some pods but times out from others. How do you debug it?AdvancedYou want to expose three HTTP services under one hostname with different paths. How?Intermediateingress-nginx returns 502 or 503 intermittently. What are the likely reasons?IntermediateA pod cannot resolve `my-svc` but can reach the pod IP. What do you test first?Beginner