🎉 DevOps Interview Prep Bundle is live — 1000+ Q&A across 20 topicsGet it →
All Fixes
Today I Fixed

Kubernetes Ingress returning 404 for all paths even though pods are running

kubernetesJun 30, 202615 minutes to fixkubernetesnetworkingtroubleshooting

My pods were running and services were healthy, but every request through the Ingress returned 404 Not Found. No errors in pod logs — the requests weren't even reaching the pods.

Root cause: The nginx Ingress controller was ignoring the Ingress resource entirely because ingressClassName: nginx was missing from the spec. Without it, the controller doesn't know the Ingress belongs to it and silently skips it.

Fix:

yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-app-ingress
  namespace: default
spec:
  ingressClassName: nginx          # <-- this was missing
  rules:
    - host: myapp.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: my-app-svc
                port:
                  number: 80

To confirm which IngressClass names exist in your cluster:

bash
kubectl get ingressclass

If you're on an older cluster still using annotations, add this to metadata.annotations instead:

yaml
kubernetes.io/ingress.class: "nginx"

After applying the corrected manifest, requests routed correctly within seconds.

Lesson: Always specify ingressClassName in the Ingress spec — without it, the controller ignores your resource entirely and you get 404s with no useful error.