Founding prices until 15 December: 30% off Pro, locked for life. See pricing

$ … 503 Service Temporarily Unavailable (ingress-nginx)

Ingress returns 503 or 404: what to check

The ingress controller has no healthy backend for the route, or no rule matches the request.

Kubernetes

What it means

ingress-nginx returns 503 when the rule matches but the backing Service has no ready endpoints, and 404 when no rule matches the host and path (or no controller handles the Ingress's class).

Causes and fixes

Most likely first. Run the check, and if it matches, apply the fix.

1. The backend Service has no endpoints

Check:

kubectl get endpoints <svc>

Fix: Fix the Service selector or the Pods' readiness.

2. Wrong service name or port in the Ingress

Check:

kubectl describe ingress <name>

Fix: Point the backend at the existing Service and its port.

3. No controller picks up the Ingress (wrong or missing ingressClassName)

Check:

kubectl get ingressclass; kubectl get ingress <name> -o yaml | grep -i class

Fix: Set ingressClassName to the installed class, or mark one class as default.

Fix it yourself

A live machine in your browser with this problem already on it. The grader checks the result.

Open the lab

No account needed for your first tries.

Related errors