-
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
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. |
| 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.
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.
I think it makes sense to validate in Helm. The reason is someone may test locally, before applying to the cluster. Failing validation on an apply may be too late
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.
Sure thanks for the feedback. I've updated to include Helm validation.
fde6977 to
b2f783d
Compare
|
/ok-to-test |
omerap12
left a comment
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!
/lgtm
/assign @adrianmoisey for final review
b2f783d to
788ee15
Compare
Signed-off-by: phuhung273 <[email protected]>
788ee15 to
696ecce
Compare
|
/lgtm |
omerap12
left a comment
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!
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
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?