用helm 方式比较方便,不然需要手动修改好多yaml
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx-2 ingress-nginx/ingress-nginx \
--namespace ingress-nginx-2 \
--set controller.ingressClassResource.name=nginx-two \
--set controller.ingressClassResource.controllerValue="k8s.io/ingress-nginx-2" \
--set controller.ingressClassResource.enabled=true \
--set controller.ingressClassByName=true
美中不足,这两个ingress-controller 不通的namespace ,配置文件会互相加载,但修改其中一个,不会影响另外一个。
参考: https://mp.weixin.qq.com/s/XaQaBdvg6DuaE-ac4G4Ohw
https://cloud.tencent.cn/developer/article/2327643
https://www.linkedin.com/pulse/how-easily-install-multiple-instances-ingress-nginx-controller-kumar-1f