-
Notifications
You must be signed in to change notification settings - Fork 4.3k
VPA: allow in-place updates below minReplicas for InPlaceOrRecreate, block eviction #9158
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: vpa-release-1.5
Are you sure you want to change the base?
VPA: allow in-place updates below minReplicas for InPlaceOrRecreate, block eviction #9158
Conversation
… eviction Signed-off-by: nikolay.tushin <nikolay.tushin@flant.com>
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions 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. |
|
|
|
Welcome @ortherion! |
|
Hi @ortherion. Thanks for your PR. I'm waiting for a kubernetes 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. DetailsInstructions 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: ortherion The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
FYI: this PR is going into a release branch, it should be targeting master. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
When a replica group has fewer live pods than
minReplicas(e.g. one pod with default--min-replicas=2), the VPA updater used to skip it entirely inGetCreatorMaps(if actual < required { continue }). As a result, withupdateMode: InPlaceOrRecreate, such groups (single replica or small sets) could never get recommendations applied: no in-place, and we also do not want to evict.This change:
belowMinReplicasflag insingleGroupStats.belowMinReplicasis set:PodsEvictionRestrictionImpl.CanEvict()returnsfalseand logs, so fallback to recreate does not run.PodsInPlaceRestrictiondoes not checkbelowMinReplicas, so in-place resize is still allowed for these groups.Result: with InPlaceOrRecreate, groups below minReplicas can receive VPA recommendations only via in-place resize. If in-place is not possible (e.g. Infeasible), we do nothing and log instead of evicting.
Users with one or few replicas and InPlaceOrRecreate can now get VPA resource updates via in-place resize without lowering minReplicas or increasing replica count. Eviction/recreate remains forbidden when below minReplicas, so availability is preserved.
Which issue(s) this PR fixes:
Fixes #9157
#9157
Special notes for your reviewer:
Unit tests in
pkg/updater/restriction/cover: in-place allowed for singleton below minReplicas, tolerance limit in one loop, and fallback to eviction blocked when below minReplicas (TestFallbackToRecreateBlockedWhenBelowMinReplicas).Does this PR introduce a user-facing change?
VPA (InPlaceOrRecreate): in-place resize is now allowed when the replica group has fewer pods than minReplicas; eviction/recreate remains blocked in that case so single-replica and small replica sets can receive recommendations without being evicted.
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: