Skip to content

feat(leader-election): leader election with multiple replicas support #5033

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

Closed

Conversation

ivankatliarchuk
Copy link
Contributor

@ivankatliarchuk ivankatliarchuk commented Jan 26, 2025

First step to resolve #2430

Description

Proposal: #5051

Reason to close: discussion with maintainers/owners

A naive implementation for a leader election, based on official example. Could split this pull request to ease review

Note; testing in progress. Feel free to comment, suggest changes

The proposal is to release leader election functionality and iterate/add improvements based on feedback. Flag had a suffix -experimental to make sure it 100% clear that logic or implementation may change at some point. Would be nice to collect feedback from community and iterate.

For leader election to be fully functional-opearational the number of bugs/currently open issues may need to be resolved as well. But this this not sound like a blocker.

kubernetes-sigs leader-election configured for

kuberntes org leader-elections configured for

In case we think that external-dns do not require HA setup with leader election or library is not fit for purpose. Same leader-election library used in (implementation sometimes differ). Most of this services have always enabled leader election funtionality

  • discheduler
  • scheduler
  • cluster-api
  • aws-load-balancer-contoller
  • certificate-manager
  • ingress-nginx
  • vertical-pod-autoscaler
  • autoscaler
  • pod-autoscaler-recommender
  • cloud-provider-openstak
  • kubernetes controller
  • ingress-gce
  • sig-storage-provisioner
  • cloud-provider-azure
  • karpenter
  • all csi-drivers
  • cluster-api-provider-aws

Checklist

  • how to test on real cluster
  • Unit tests updated
  • Check if metrics still available. curl localhost:7979/metrics OK
  • Check healthcheck still working. curl localhost:7979/healthz OK
  • End user documentation updated

some checks
running leader election (leader identified)
Screenshot 2025-01-26 at 10 58 23

standby replica
Screenshot 2025-01-26 at 10 40 22

leader identify changed
Screenshot 2025-01-26 at 10 52 00

lease updated or leader change

Screenshot 2025-01-26 at 11 14 15

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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 k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 26, 2025
@k8s-ci-robot k8s-ci-robot requested a review from szuecs January 26, 2025 08:32
@ivankatliarchuk ivankatliarchuk marked this pull request as draft January 26, 2025 08:32
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 26, 2025
@ivankatliarchuk ivankatliarchuk changed the title feat(leader-election): support multiple replicas feat(leader-election): support multiple replicas with leader election mechanism Jan 26, 2025
@ivankatliarchuk ivankatliarchuk changed the title feat(leader-election): support multiple replicas with leader election mechanism feat(leader-election): leader election with multiple replicas support Jan 26, 2025
@ivankatliarchuk
Copy link
Contributor Author

/retest-required

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 26, 2025
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 29, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@ivankatliarchuk
Copy link
Contributor Author

/close not-planned

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support multiple replicas for reliability
2 participants