Skip to content

Commit

Permalink
Add docs on Election ID to Multiple Ingress Controller guide (#8855)
Browse files Browse the repository at this point in the history
  • Loading branch information
qilong.qiu authored Jul 22, 2022
1 parent c86d50e commit a581a7b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,13 @@ If you start Ingress-Nginx B with the command line argument `--watch-ingress-wit
--set controller.ingressClassByName=true
```
- If you need to install yet another instance, then repeat the procedure to create a new namespace, change the values such as names & namespaces (for example from "-2" to "-3"), or anything else that meets your needs.
- If you need to install all instances in the same namespace, then you need to specify a different **election id**, like this:
```
helm install ingress-nginx-2 ingress-nginx/ingress-nginx \
--namespace kube-system \
--set controller.electionID=nginx-two-leader \
--set controller.ingressClassResource.name=nginx-two \
--set controller.ingressClassResource.controllerValue="example.com/ingress-nginx-2" \
--set controller.ingressClassResource.enabled=true \
--set controller.ingressClassByName=true
```
4 changes: 3 additions & 1 deletion docs/user-guide/multiple-ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To fix this problem, use [IngressClasses](https://kubernetes.io/docs/concepts/se

If all ingress controllers respect IngressClasses (e.g. multiple instances of ingress-nginx v1.0), you can deploy two Ingress controllers by granting them control over two different IngressClasses, then selecting one of the two IngressClasses with `ingressClassName`.

First, ensure the `--controller-class=` and `--ingress-class` are set to something different on each ingress controller:
First, ensure the `--controller-class=` and `--ingress-class` are set to something different on each ingress controller, If your additional ingress controller is to be installed in a namespace, where there is/are one/more-than-one ingress-nginx-controller(s) already installed, then you need to specify a different unique `--election-id` for the new instance of the controller.

```yaml
# ingress-nginx Deployment/Statefulset
Expand All @@ -19,6 +19,7 @@ spec:
- name: ingress-nginx-internal-controller
args:
- /nginx-ingress-controller
- '--election-id=ingress-controller-leader'
- '--controller-class=k8s.io/internal-ingress-nginx'
- '--ingress-class=k8s.io/internal-nginx'
...
Expand Down Expand Up @@ -53,6 +54,7 @@ or if installing with Helm:

```yaml
controller:
electionID: ingress-controller-leader
ingressClassResource:
name: internal-nginx # default: nginx
enabled: true
Expand Down

0 comments on commit a581a7b

Please sign in to comment.