<p>Can anyone explain why there is a requirement for leader election when having an ingress-controller (nginx) deployment with multiple replica's?
Is there a sync going on between them?
What is actually synced?</p>
<p>I searched the documentation and found ... nothing
I know there is a configmap that holds the POD name of the leader but that's pretty much it.</p>
<p>I also see that a leader election is going on when starting the pod</p>
<pre><code>I0828 16:08:39.500651       7 nginx.go:307] Starting NGINX process
I0828 16:08:39.500779       7 leaderelection.go:242] attempting to acquire leader lease ingresscontroller/ingress-controller-leader...
I0828 16:08:39.500890       7 nginx.go:327] Starting validation webhook on :8443 with keys /usr/local/certificates/cert /usr/local/certificates/key
I0828 16:08:39.503049       7 controller.go:141] Configuration changes detected, backend reload required.
I0828 16:08:39.504322       7 status.go:86] new leader elected: ingress-nginx-controller-xxxxxx-xxxx
I0828 16:08:39.728368       7 controller.go:157] Backend successfully reloaded.
I0828 16:08:39.728416       7 controller.go:166] Initial sync, sleeping for 1 second.
</code></pre>
<p>Can anyone provide some insights on why there is a requirement for a leader?</p>
<p>Thanks in advance!</p>
<p>Bregt</p>

<p>excerpt from the <a href="https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/command-line-arguments/" rel="nofollow noreferrer">documents</a>:</p>
<blockquote>
<p>-enable-leader-election<br />
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)</p>
</blockquote>
