-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(chart): VPA Updater PodDisruptionBudget #8718
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
base: master
Are you sure you want to change the base?
Conversation
|
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 Once the patch is verified, the new status will be reflected by the 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: phuhung273 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 |
| selector: | ||
| matchLabels: | ||
| {{- include "vertical-pod-autoscaler.updater.selectorLabels" . | nindent 6 }} | ||
| {{- if .Values.updater.podDisruptionBudget.minAvailable }} |
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.
From the Kubernetes documentation:
You can specify only one of maxUnavailable and minAvailable in a single PodDisruptionBudget. maxUnavailable can only be used to control the eviction of pods that all have the same associated controller managing them. In the examples below, "desired replicas" is the scale of the controller managing the pods being selected by the PodDisruptionBudget.
See how we handle this in the Cluster Autoscaler chart:
Essentially, we want to ensure we only default to one or the other (you've already done the equivalent of that by defaulting maxUnavailable to empty. But also IMO the checks in the template foo as well are useful:
- Fail processing if both values are set
- Only inject a min or max value if it is the only one set
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 taking a look Jack. I can see that validation in
Lines 1 to 4 in f7fc231
| {{- if and .Values.admissionController.enabled .Values.admissionController.podDisruptionBudget.enabled -}} | |
| {{- if and .Values.admissionController.podDisruptionBudget.minAvailable .Values.admissionController.podDisruptionBudget.maxUnavailable }} | |
| {{- fail "Only one of admissionController.podDisruptionBudget.minAvailable or admissionController.podDisruptionBudget.maxUnavailable should be set." }} | |
| {{- end }} |
But I decided not to do the same since k8s already has builtin validation
Error: 1 error occurred:
* PodDisruptionBudget.policy "vpa-vertical-pod-autoscaler-updater" is invalid: spec: Invalid value: {"MinAvailable":1,"Selector":{"matchLabels":{"app.kubernetes.io/component":"updater","app.kubernetes.io/instance":"vpa","app.kubernetes.io/name":"vertical-pod-autoscaler"}},"MaxUnavailable":1,"UnhealthyPodEvictionPolicy":null}: minAvailable and maxUnavailable cannot be both setCan you have a try and let me know if we need our own validation.
Signed-off-by: phuhung273 <[email protected]>
fde6977 to
b2f783d
Compare
|
|
||
| # Number of Updater replicas to create. | ||
| replicas: 1 | ||
| replicas: 2 |
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.
If there are more than 1 replicas running for the updater, it needs to have a lease, similar to
Lines 59 to 64 in 6177945
| - --leader-elect=true | |
| - --leader-elect-resource-namespace={{ .Values.recommender.leaderElection.resourceNamespace | default .Release.Namespace }} | |
| - --leader-elect-resource-name={{ .Values.recommender.leaderElection.resourceName }} | |
| - --leader-elect-lease-duration={{ .Values.recommender.leaderElection.leaseDuration }} | |
| - --leader-elect-renew-deadline={{ .Values.recommender.leaderElection.renewDeadline }} | |
| - --leader-elect-retry-period={{ .Values.recommender.leaderElection.retryPeriod }} |
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 Adrian for taking a look. While adding leaderLection i found another issue: update-role and updater-rolebinding don't make sense. So decided to create a separate PR #8777 to discuss. Can you have a look at it first ?
|
/ok-to-test |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Helm chart support PodDisruptionBudget for VPA Updater
Which issue(s) this PR fixes:
Relates #8587
Special notes for your reviewer:
Quick test using
Does this PR introduce a user-facing change?