Overview
If you need to deploy multiple Nginx Ingress Controllers, that is, you want to use different traffic entries with different Ingress rules:
You can deploy multiple Nginx Ingress Controllers for the cluster and specify different ingressClassName
for different Ingresses.
This document describes the configuration methods for installing multiple Nginx Ingress Controllers.
Configuration Method
To install multiple Nginx Ingress Controllers, you need to specify ingressClassName
in values.yaml
(ensure there are no conflicts):
controller:
ingressClassName: prod
ingressClassResource:
name: prod
controllerValue: k8s.io/ingress-prod
Note:
Three fields need to be changed simultaneously.
Additionally, the release names for multiple instances must be different from those of installed ones. Even if the namespaces are different, the release names cannot be the same (to avoid ClusterRole conflicts). The sample code is as follows:
helm upgrade --install prod ingress-nginx/ingress-nginx \\
--namespace ingress-nginx --create-namespace \\
-f values.yaml
When creating Ingress resources, you also need to specify the corresponding ingressClassName
:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx
spec:
ingressClassName: prod
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx
port:
number: 80
Apakah halaman ini membantu?