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

vpa-{updater,recommender}: Add support for leader election #6985

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

ialidzhikov
Copy link
Contributor

@ialidzhikov ialidzhikov commented Jun 28, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds support for leader election in vpa-updater and vpa-recommender.

Which issue(s) this PR fixes:

Fixes #6846

Special notes for your reviewer:

This PR is strongly inspired by how leader election is built for the cluster-autoscaler.

Does this PR introduce a user-facing change?

vpa-updater and vpa-recommender do now support leader election.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@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. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/vertical-pod-autoscaler labels Jun 28, 2024
@ialidzhikov ialidzhikov marked this pull request as ready for review July 2, 2024 06:55
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 2, 2024
@ialidzhikov
Copy link
Contributor Author

/cc @kwiesmueller

@kwiesmueller
Copy link
Member

/assign @voelzmo @raywainman
Could you have a look please.

@adrianmoisey
Copy link
Member

I build and tested this locally, and it all works as expected. Very nice, this is something I've also been wanting.

@voelzmo
Copy link
Contributor

voelzmo commented Jul 8, 2024

/lgtm

Thanks! Great catch of taking care of the /health-check endpoint for the passive replicas!
I think it is also important that the recommender gets killed and re-created when it loses leadership, so we don't end up in a situation where oudated in-memory aggregations are taken into account. The way it is implemented here, we should always end up using a fresh initialization from history.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 8, 2024
@raywainman
Copy link
Contributor

/lgtm

@voelzmo
Copy link
Contributor

voelzmo commented Jul 9, 2024

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ialidzhikov, voelzmo

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2024
@k8s-ci-robot k8s-ci-robot merged commit d7091a9 into kubernetes:master Jul 9, 2024
7 checks passed
@ialidzhikov ialidzhikov deleted the enh/vpa-leader-election branch July 10, 2024 07:42
@raywainman raywainman mentioned this pull request Aug 6, 2024
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. area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Implement Leader Elections for VPA Updater and Recommender
6 participants