Controller: Make Leader Election TTL configurable. (#11142)

* feature(leader_ttl): feature to customize ttl to leader be re-elected

* fix(review): docs
This commit is contained in:
Matheus Fidelis 2024-03-28 10:36:23 -03:00 committed by GitHub
parent aedb13c9fa
commit 7c8af4928b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 93 additions and 8 deletions

View file

@ -274,8 +274,9 @@ func (n *NGINXController) Start() {
if !n.cfg.DisableLeaderElection {
electionID := n.cfg.ElectionID
setupLeaderElection(&leaderElectionConfig{
Client: n.cfg.Client,
ElectionID: electionID,
Client: n.cfg.Client,
ElectionID: electionID,
ElectionTTL: n.cfg.ElectionTTL,
OnStartedLeading: func(stopCh chan struct{}) {
if n.syncStatus != nil {
go n.syncStatus.Run(stopCh)