Clarification on changing --ingress-class when deploying under isolated namespaces

Hello. The documentation on running multiple ingress controllers in the same cluster suggests[1] that I can use namespaces to isolate/coordinate which ingresses and kongingresses should affect which ingress controller. However, the documentation for CLI arguments[2] says that the --ingress-class argument is to be used when multiple ingress controllers are deployed on the same cluster (not namespace). If I’m using namespace-based isolation, do I still need each ingress controller to specify a unique ingress class?


The way I like to think about ingress.class annotation is that it is a way to prevent multiple Ingress Controllers to fight over an Ingress resource. If you can ensure that in a specific namespace, there is only one ingress controller responsible for satisfying the Ingress resources, then you don’t need to use ingress class.

How can you ensure there is only one ingress controller serving the Ingress resources in namespace? I have installed Ingress controller in one namespace, and it does handle/serve ingress created in another namespace.

Depends on how your setup is.

If you have multiple cluster-level Ingress Controllers running, then you have to use ingress-class.

If you have ingress controllers that are scoped to namespaces, then all you need to do is ensure that there is only one controller running in a namespace.