Skip to content
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

feat: add leader-election option #20

Merged
merged 12 commits into from
Aug 1, 2024

Conversation

ugur99
Copy link
Contributor

@ugur99 ugur99 commented Jul 27, 2024

This PR introduces a leader election mechanism for the controller, which could be critical for high availability of the service in large clusters.

Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 27, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @ugur99!

It looks like this is your first PR to kubernetes-sigs/node-ipam-controller 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/node-ipam-controller has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 27, 2024
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
main.go Outdated Show resolved Hide resolved
@aojea
Copy link
Contributor

aojea commented Jul 29, 2024

overall lgtm but I didn't do a thorughful review
/assign @sarveshr7 @mneverov

Do you mind doing the final review?

main.go Show resolved Hide resolved
pkg/leaderelection/leaderelection.go Outdated Show resolved Hide resolved
pkg/leaderelection/leaderelection.go Outdated Show resolved Hide resolved
pkg/leaderelection/leaderelection.go Outdated Show resolved Hide resolved
pkg/leaderelection/leaderelection.go Show resolved Hide resolved
charts/node-ipam-controller/templates/serviceaccount.yaml Outdated Show resolved Hide resolved
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
@ugur99 ugur99 requested a review from mneverov July 30, 2024 20:46
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
Copy link
Member

@mneverov mneverov left a comment

Choose a reason for hiding this comment

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

Nits only. Already looks amazing.

LeaderElection has an option to specify health checks adapter. I don't want to hold this PR for longer, so @ugur99 could you please create an issue to investigate if the adapter can be useful?

main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
charts/node-ipam-controller/templates/serviceaccount.yaml Outdated Show resolved Hide resolved
charts/node-ipam-controller/templates/serviceaccount.yaml Outdated Show resolved Hide resolved
charts/node-ipam-controller/templates/serviceaccount.yaml Outdated Show resolved Hide resolved
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
charts/node-ipam-controller/templates/deployment.yaml Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
@ugur99 ugur99 requested a review from mneverov July 31, 2024 20:08
Copy link
Member

@mneverov mneverov left a comment

Choose a reason for hiding this comment

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

typo

Copy link
Member

@mneverov mneverov left a comment

Choose a reason for hiding this comment

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

Tests are failing because the whole reconciliation loop run in a separate goroutine, so the main function exits immediately

main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
@ugur99 ugur99 requested a review from mneverov August 1, 2024 18:34
@mneverov
Copy link
Member

mneverov commented Aug 1, 2024

lgtm

@mneverov mneverov added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 1, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mneverov, ugur99

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

The pull request process is described 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 merged commit 1323bc8 into kubernetes-sigs:main Aug 1, 2024
8 checks passed
@mneverov
Copy link
Member

mneverov commented Aug 1, 2024

@ugur99 thanks for your contribution!

@ugur99
Copy link
Contributor Author

ugur99 commented Aug 1, 2024

thank you for your support and quick action @mneverov @aojea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants