简介
本文介绍K8S部署ingress时的报错:Internal error occurred: failed calling webhook “validate.nginx.ingress.kubernetes.io”: failed to call webhook: Post xxx
问题描述
创建ingress时报错了,报错如下:
我的ingress.yaml文件:
--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: test-ingress namespace: test spec: ingressClassName: nginx rules: - host: "tomcat.demo.com" http: paths: - pathType: Prefix path: "/" backend: service: name: tomcat-service port: number: 8080 - host: "nginx.demo.com" http: paths: - pathType: Prefix path: "/" backend: service: name: nginx-service port: number: 80
原因分析
刚开始使用yaml的方式创建nginx-ingress,创建没成功,就用kubectl delete -f xxx删除了它相关资源,但是ValidatingWebhookConfiguration ingress-nginx-admission没有删除。
问题解决
1.查找问题配置
kubectl get validatingwebhookconfigurations
结果
2.删除配置
kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission
结果
3.重新创建ingress
创建成功!
请先
!