Interview Prep/Kubernetes/Services, Ingress and DNS

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 →

  1. kubectl describe ingress app and check Rules and Events
  2. Verify ingressClassName matches the controller class (kubectl get ingressclass)
  3. Check the backend Service name, port and that it has endpoints
  4. Curl with the correct Host header, because a 404 usually means no matching host rule
  5. kubectl -n ingress-nginx logs deploy/ingress-nginx-controller for 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.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, Ingress and DNS