Skip to content

nfd-master: Auto-disable leader election if replicaCount is 1#2435

Open
ozhuraki wants to merge 1 commit intokubernetes-sigs:masterfrom
ozhuraki:master-leader-election
Open

nfd-master: Auto-disable leader election if replicaCount is 1#2435
ozhuraki wants to merge 1 commit intokubernetes-sigs:masterfrom
ozhuraki:master-leader-election

Conversation

@ozhuraki
Copy link
Contributor

Closes: #2389

@netlify
Copy link

netlify bot commented Feb 10, 2026

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit dedfb02
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-nfd/deploys/698b56c3a8cd0f0008615824
😎 Deploy Preview https://deploy-preview-2435--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 10, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ozhuraki
Once this PR has been reviewed and has the lgtm label, please assign marquiz for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 10, 2026
Copy link
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +314 to 319
if m.config.ReplicaCount == 1 {
m.isLeader = true
} else if m.args.EnableLeaderElection {
go m.startLeaderElectionHandler()
}
go m.nfdAPIUpdateHandler()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
}

@fmuyassarov
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 11, 2026
@k8s-ci-robot
Copy link
Contributor

@ozhuraki: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-node-feature-discovery-verify-master dedfb02 link true /test pull-node-feature-discovery-verify-master
pull-node-feature-discovery-e2e-test-master dedfb02 link true /test pull-node-feature-discovery-e2e-test-master

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.

Details

Instructions 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.

Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a flag to disable leader election for NFD-master

4 participants