Internal error occurred: failed calling webhook “validate.nginx.ingress.kubernetes.io”: failed to call webhook

Shi
CI/CD/DevOps
Published in
Oct 1, 2022

--

When I was trying to deploy nginx ingress on KIND in windows subsystem Linux (WSL2) environment,

kubectl apply --filename https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yamlkubectl wait --namespace ingress-nginx \
--for=condition=ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=180s
kubectl apply --filename nginx-ingress.yaml

I run into the following error:

Error from server (InternalError):: Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": failed to call webhook: Post "https://ingress-nginx-controller-admission.ingress-nginx.svc:443/networking/v1/ingresses?timeout=10s": dial tcp 10.96.135.179:443: "connect: connection refused"

I found the following workaround from https://stackoverflow.com/questions/61616203/nginx-ingress-controller-failed-calling-webhook,

kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission

This solves my problem.

--

--

Shi
CI/CD/DevOps

I am a coder/engineer/application security specialist. I like to play around with language and tools; I have strong interest in efficiency improvement.