-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add kubernetes election module #3721
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
922ebcf
to
68897bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR. Are you happy to be an owner of the new k8s election code module? The core team doesn't have the time or expertise to take on ownership of this. On the whole this role is largely being responsible for reviewing code changes from other users and any dependency updates that require code changes.
I've left some comments on the old code that was refactored to make space for this but I haven't reviewed the new code yet. I'm at a summit this week but this is on my radar for when I have time.
Introduce a new election module using the Kubernetes Lease API. Modify the existing mechanism to allow selection of election mechanisms by introducing the `--election_system` parameter, following the same pattern used for storage and quota system selection.
Yes, I can take ownership |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tomas, thanks for confirming you can take ownership of this submodule. That's great.
I've put a couple of comments on the existing files. My primary concern is that we don't break behaviour for existing users, and that we avoid too much entangling with introducing this new module. Once I'm happy with the changes around the old codebase I'll take a deeper dive review into the new module implementation.
BTW, one thing you can do that will make reviews far easier for me is to keep each round of commits in their own commit in the chain. We'll squash them together when merging at the end. This makes it much easier for me to step through the new code changes and be sure that no changes have been made to code I've already reviewed. Thanks!
Co-authored-by: Martin Hutchinson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks! See remaining comments around copyright dates etc, but I'm happy with this now.
The final remaining files to be touched put a bow on this and celebrate this feature and your contribution:
CONTRIBUTORS.md
- add yourself here, if you like/docs/Feature_Implementation_Matrix.md
- please mention this feature and list yourself as a maintainerCHANGELOG.md
- note that there is now support for this so everyone can find out on the next release
/gcbrun |
Once the change to |
I'll also take this opportunity to encourage you to join the Slack community if that's an option for you. There's an invite link in the main README. |
/gcbrun |
Looks like there could be a race condition in the new code:
|
I modify the code to fix possible race condition on
|
/gcbrun |
I added an additional fix targeting the Resign method. Unfortunately, I wasn't able to reproduce the issue locally, so I'm hoping this change addresses a new data race condition recently detected by CI. |
Another data race:
|
/gcbrun |
This PR adds a new leader election implementation using the Kubernetes Lease API.
By leveraging Kubernetes Lease resources, this implementation provides an alternative backend for leader election. It simplifies deployments on Kubernetes by removing the need for a secondary etcd cluster when running Kubernetes workloads.
Fixes #3431
Checklist