nfd-master: Auto-disable leader election if replicaCount is 1#2435
nfd-master: Auto-disable leader election if replicaCount is 1#2435ozhuraki wants to merge 1 commit intokubernetes-sigs:masterfrom
Conversation
Signed-off-by: Oleg Zhurakivskyy <[email protected]>
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ozhuraki The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @ozhuraki. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
fmuyassarov
left a comment
There was a problem hiding this comment.
Looks good, there is one nitty comment that I have.
Also, I wonder if we would like to have it mentioned in the document? For example here and similarly in the kustomize related deployment docs.
| if m.config.ReplicaCount == 1 { | ||
| m.isLeader = true | ||
| } else if m.args.EnableLeaderElection { | ||
| go m.startLeaderElectionHandler() | ||
| } | ||
| go m.nfdAPIUpdateHandler() |
There was a problem hiding this comment.
Maybe to avoid accidental false election triggers we could be explicit here that we want to start the election only when there is more than one replica? In other words,
if m.config.ReplicaCount == 1 {
m.isLeader = true
} else if m.config.ReplicaCount > 1 && m.args.EnableLeaderElection {
go m.startLeaderElectionHandler()
}|
/ok-to-test |
|
@ozhuraki: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
marquiz
left a comment
There was a problem hiding this comment.
There's no config option for replicacount (and there should not be). We need to fix this in the Helm chart. If replicas > 1 then -enable-leader-election
Closes: #2389