Skip to content

Conversation

@phuhung273
Copy link
Contributor

@phuhung273 phuhung273 commented Nov 9, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Helm chart support leaderElection for VPA Updater
  • Update updater-role to only create when leaderElection.enabled. The role name and its permissions clearly states that it belongs to leaderElection instead of serviceAccount.

Which issue(s) this PR fixes:

Relates #8587

Special notes for your reviewer:

Quick test using

helm upgrade --install vpa ./vertical-pod-autoscaler/charts/vertical-pod-autoscaler/ \
  -n vpa --create-namespace

Does this PR introduce a user-facing change?

NONE

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


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. 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. do-not-merge/needs-area area/vertical-pod-autoscaler labels Nov 9, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @phuhung273. Thanks for your PR.

I'm waiting for a github.com 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.

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. and removed do-not-merge/needs-area labels Nov 9, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 9, 2025
Copy link
Member

@omerap12 omerap12 left a comment

Choose a reason for hiding this comment

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

Thanks for this, overall looks ok but two comments from my end :)

Comment on lines 35 to 48
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "vertical-pod-autoscaler.updater.fullname" . }}-leader-locking
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "vertical-pod-autoscaler.updater.fullname" . }}-leader-locking
subjects:
- kind: ServiceAccount
name: {{ include "vertical-pod-autoscaler.updater.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
Copy link
Member

Choose a reason for hiding this comment

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

Since all other components use a dedicated role-binding file, can we align this one as well? I don’t mind if the role definition is included in the same file as the role binding, but we should keep it consistent with the other components.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Yeah we should align all components :)

@omerap12
Copy link
Member

omerap12 commented Nov 9, 2025

/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 Nov 9, 2025
@phuhung273 phuhung273 force-pushed the update-leader-election branch 2 times, most recently from 7894677 to d7c1988 Compare November 10, 2025 01:10
- apiGroups:
- "coordination.k8s.io"
resourceNames:
- vpa-updater
Copy link
Member

Choose a reason for hiding this comment

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

@adrianmoisey , do you think we can remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing vpa-updater from resourceNames and still work. Waiting if Adrian knows other edge cases.

Copy link
Member

Choose a reason for hiding this comment

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

Yup, I think that's safe to remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, it is removed

@phuhung273 phuhung273 force-pushed the update-leader-election branch from d7c1988 to 71433cc Compare November 10, 2025 11:50
@phuhung273 phuhung273 force-pushed the update-leader-election branch from 71433cc to 6645a73 Compare November 10, 2025 12:07
Copy link
Member

@omerap12 omerap12 left a comment

Choose a reason for hiding this comment

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

Thanks!
/assign @adrianmoisey

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 10, 2025
@adrianmoisey
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianmoisey, omerap12, phuhung273

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

@omerap12
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 16, 2025
@omerap12
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit d923d53 into kubernetes:master Nov 16, 2025
13 checks passed
@phuhung273 phuhung273 deleted the update-leader-election branch November 16, 2025 23:21
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants