Internal error occurred: failed calling webhook “validate.nginx.ingress.kubernetes.io”: failed to call webhook
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=180skubectl 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.