Home > Mobile >  Kubernetes 2 default IngressClasses were found, only 1 allowed
Kubernetes 2 default IngressClasses were found, only 1 allowed

Time:09-02

When I try to create ingress controller on my local machine(mac) using DockerDesktop, I get this error:

error when creating ingress/default.yaml": ingresses.networking.k8s.io "default-test" is forbidden: Internal error occurred: 2 default IngressClasses were found, only 1 allowed

And another error that I faced today is when I create NodePort service and exposed it on port 30200 for example, and when I try to connect to localhost:30200, I get this error:

curl: (7) Failed to connect to localhost port 30036: Connection refused

The only way to connect to the service is using port forwarding.

CodePudding user response:

It seems like you have multiple default ingress classes. Check it out by running.

$kubectl get ingressclass

If you do not specify a particular ingress class when creating your ingress controller, it will fall back on the default ingress class. However, as you have two default ingress classes, it fails. For more info please refer to the docs. You may want to explicitly set a ingress class for your ingress controller or make your cluster having only a single default ingress class.

  • Related