error when creating "ingress-myapp.yaml": Internal error occurred: failed calling webhook

created at 08-27-2021 views: 37

k8s reports an error when executing the ingress yaml file: the error is as follows:

[root@k8s-master01 baremetal]# kubectl apply  -f ingress-test.yaml
Error from server (InternalError): error when creating "ingress-myapp.yaml": Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": Post "https://ingress-nginx-controller-admission.ingress-nginx.svc:443/networking/v1/ingresses?timeout=10s": dial tcp 10.0.0.129:443: connect: invalid argument

View ValidatingWebhookConfiguration

[root@k8s-master01 baremetal]# kubectl get ValidatingWebhookConfiguration
NAME                                  WEBHOOKS   AGE
ingress-nginx-admission               1          43m
network.kubesphere.io                 1          3d5h
resourcesquotas.quota.kubesphere.io   1          3d5h
users.iam.kubesphere.io               1          3d5h

Delete ingress-nginx-admission

[root@k8s-master01 baremetal]# kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission
validatingwebhookconfiguration.admissionregistration.k8s.io "ingress-nginx-admission" deleted
[root@k8s-master01 baremetal]#

# Back to normal
[root@k8s-master01 baremetal]# kubectl apply  -f ingress-test.yaml
ingress.networking.k8s.io/ngress-test created
created at:08-27-2021
edited at: 08-27-2021: