Skip to content

Creating an Ingress: failed calling webhook validate.nginx.ingress…

AItested on kind v0.33.0, ingress-nginx

ingress-nginx checks every new Ingress object through an admission webhook. Right after installation the controller pod is not running yet – the API server cannot reach the webhook and rejects the object.

Symptom

Error from server (InternalError): error when creating "echo.yaml": Internal error
occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": ...
connect: connection refused

In the course this happens when echo.yaml with deployment, service and ingress is applied too soon after the controller.

Diagnosis

Once the controller works, an unknown host returns 404 from the default backend.

curl -s -o /dev/null -w '%{http_code}\n' http://nix.ki.localtest.me/
404

Causes

connection refusedThe controller pod is not running yet

The webhook belongs to the controller pod. While it starts, the API server rejects every Ingress object it would have to have checked.

InternalErrorNothing wrong with your file

The message comes from the API server, not from your YAML. The same file goes through as soon as the controller is ready.

Fix

Wait for the controller's rollout and apply the file again.
kubectl apply -f ~/ki-lab/tag01/echo.yaml
kubectl -n ki-chat rollout status deploy/echo
curl -s http://echo.ki.localtest.me/
deployment "echo" successfully rolled out
Hallo aus kind

Don't: Delete the ValidatingWebhook so the Ingress goes through – then nobody checks broken Ingress objects any more.

▶
Break it yourself and find it – free
LLMs on Kubernetes hands-on, Day 1: kind for AI – ingress, storage for models, preloading images, quotas.
Go to day 1 →

FAQ

How do I wait for the controller reliably in a script?

With kubectl rollout status on the controller deployment – apply Ingress objects only after that.

Why 404 for an unknown host?

That is the controller's default backend – it shows that ingress-nginx runs but no Ingress matches that host.

Related error patterns

More