Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable leader election by default #980

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Enable leader election as default argument in manifests
  • Loading branch information
Raul Marrero committed Jun 8, 2020
commit ff2923fa1172d2b084b06efca10612e9ff3443d6
4 changes: 2 additions & 2 deletions cmd/nginx-ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ var (
reportIngressStatus = flag.Bool("report-ingress-status", false,
"Update the address field in the status of Ingresses resources. Requires the -external-service flag, or the 'external-status-address' key in the ConfigMap.")

leaderElectionEnabled = flag.Bool("enable-leader-election", false,
"Enable Leader election to avoid multiple replicas of the controller reporting the status of Ingress, VirtualServer and VirtualServerRoute resources -- only one replica will report status. See -report-ingress-status flag.")
leaderElectionEnabled = flag.Bool("enable-leader-election", true,
"Enable Leader election to avoid multiple replicas of the controller reporting the status of Ingress, VirtualServer and VirtualServerRoute resources -- only one replica will report status (default true). See -report-ingress-status flag.")

leaderElectionLockName = flag.String("leader-election-lock-name", "nginx-ingress-leader-election",
`Specifies the name of the ConfigMap, within the same namespace as the controller, used as the lock for leader election. Requires -enable-leader-election.`)
Expand Down
1 change: 0 additions & 1 deletion deployments/daemon-set/nginx-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ spec:
#- -v=3 # Enables extensive logging. Useful for troubleshooting.
#- -report-ingress-status
#- -external-service=nginx-ingress
#- -enable-leader-election
#- -enable-prometheus-metrics
#- -global-configuration=$(POD_NAMESPACE)/nginx-configuration
1 change: 0 additions & 1 deletion deployments/daemon-set/nginx-plus-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,5 @@ spec:
#- -v=3 # Enables extensive logging. Useful for troubleshooting.
#- -report-ingress-status
#- -external-service=nginx-ingress
#- -enable-leader-election
#- -enable-prometheus-metrics
#- -global-configuration=$(POD_NAMESPACE)/nginx-configuration
1 change: 0 additions & 1 deletion deployments/deployment/nginx-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ spec:
#- -v=3 # Enables extensive logging. Useful for troubleshooting.
#- -report-ingress-status
#- -external-service=nginx-ingress
#- -enable-leader-election
#- -enable-prometheus-metrics
#- -global-configuration=$(POD_NAMESPACE)/nginx-configuration
1 change: 0 additions & 1 deletion deployments/deployment/nginx-plus-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ spec:
#- -v=3 # Enables extensive logging. Useful for troubleshooting.
#- -report-ingress-status
#- -external-service=nginx-ingress
#- -enable-leader-election
#- -enable-prometheus-metrics
#- -global-configuration=$(POD_NAMESPACE)/nginx-configuration
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Below we describe the available command-line arguments:

.. option:: -enable-leader-election

Enables Leader election to avoid multiple replicas of the controller reporting the status of Ingress, VirtualServer and VirtualServerRoute resources -- only one replica will report status.
Enables Leader election to avoid multiple replicas of the controller reporting the status of Ingress, VirtualServer and VirtualServerRoute resources -- only one replica will report status (default true).

See :option:`-report-ingress-status` flag.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ The Ingress controller must be configured to report an Ingress status:
2. Define a source for an external address. This can be either of:
1. A user defined address, specified in the `external-status-address` ConfigMap key.
2. A Service of the type LoadBalancer configured with an external IP or address and specified by the `-external-service` command-line flag.
3. If you're running multiple replicas of the Ingress controller, enable leader election with the `-enable-leader-election` flag
to ensure that only one replica updates an Ingress status.
4. By default, the Ingress controller will use a ConfigMap with the name `nginx-ingress-leader-election` as the lock. This can be customised via the `-leader-election-lock-name` flag.

See the docs about [ConfigMap keys](/nginx-ingress-controller/configuration/global-configuration/configmap-resource) and [Command-line arguments](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments).

Expand Down Expand Up @@ -110,9 +107,6 @@ The Ingress controller must be configured to report a VirtualServer or VirtualSe
1. If you want the Ingress controller to report the `externalEndpoints`, define a source for an external address (Note: the rest of the fields will be reported without the external address configured). This can be either of:
1. A user defined address, specified in the `external-status-address` ConfigMap key.
2. A Service of the type LoadBalancer configured with an external IP or address and specified by the `-external-service` command-line flag.
1. If you're running multiple replicas of the Ingress controller, enable leader election with the `-enable-leader-election` flag
to ensure that only one replica updates an Ingress status.
1. By default, the Ingress controller will use a ConfigMap with the name `nginx-ingress-leader-election` as the lock. This can be customised via the `-leader-election-lock-name` flag.

See the docs about [ConfigMap keys](/nginx-ingress-controller/configuration/global-configuration/configmap-resource) and [Command-line arguments](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments).

Expand Down