I have 2 namespaces in my kubernetes cluster, one called first-nginx
and the other called second-nginx
. I am using the chart ingress-nginx.. NOT the stable/nginx-ingress as that is now deprecated.
I am attemtping to install multiple nginx controllers, because i need them to be exposed by an already created static ip in GKE. I have successfully installed my first chart in the first-nginx namespace like this
helm install nginx-ingress ingress-nginx/ingress-nginx --namespace first-nginx --set ingress-class="nginx-devices --set controller.service.loadBalancerIP={first-IP-address}"
I am now attempting to do the same with in the second namespace like this
helm install nginx-ingress-2 ingress-nginx/ingress-nginx --namespace second-nginx --set ingress-class="nginx-devices --set controller.service.loadBalancerIP={second-IP-address}"
However i get an error as shown below.
Error: rendered manifests contain a resource that already exists.
Unable to continue with install: IngressClass "nginx" in namespace ""
exists and cannot be imported into the current release: invalid
ownership metadata; annotation validation error: key
"meta.helm.sh/release-name" must equal "nginx-ingress-2": current
value is "nginx-ingress"; annotation validation error: key
"meta.helm.sh/release-namespace" must equal "second-nginx": current
value is "first-nginx"
How do i solve this ? This seems to work when i use the stable/nginx-ingress chart where i can do something like this helm install nginx-ingress-devices stable/nginx-ingress --namespace second-nginx --set controller.ingressClass="nginx-devices"
How do i acheive the same thing with the ingress-nginx
2
Answers
you should use
controller.ingressClassResource.name
to set different ingress class names for themYou need to define additional
controller.ingressClassResource.controllerValue
for the second ingress-nginx, so that when an ingress resource refer to this class, it knows which controller to engage.