I try to create a second ingress for my azure Kubernetes cluster (AKS). One for company internal use and one for customers.
The first controller is built by the following script:
https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.27.0/deploy/static/mandatory.yaml
And the service:
The official tutorial from Nginx (https://kubernetes.github.io/ingress-nginx/user-guide/multiple-ingress/) says that I need to use the --ingress-class flag to separate the two controllers. And when both controllers are created, I need to reference each resource which controller is used by ingress.class annotation.
first question
That makes sense because I can create two different ingresses with routing specifications. But do I also need to reference the controller in the Nginx-service?
second question
I edit the mandatory.yaml on my machine and applied it by a local YAML file. So I passed the --ingress-class flag to the arguments of the controller (started on mandatory.yaml line 218):
containers:
- name: nginx-ingress-controller
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:master
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/nginx-configuration
- --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
- --udp-services-configmap=$(POD_NAMESPACE)/udp-services
- --publish-service=$(POD_NAMESPACE)/ingress-nginx
- --annotations-prefix=nginx.ingress.kubernetes.io
- --ingress-class=nginx-external
When I redeploy it the mandatory.yaml with --ingress-class=nginx-internal, the existing controller will be reconfigured, but no second controller will be deployed. What I'm doing wrong?