VPA: add new TargetHigherThanRequestsAndOOM eviction requirement #10678
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #10678"
general
weight: 0.35
adrianmoisey
What type of PR is this?
/kind feature
/kind api-change
<!--
Add one of the following kinds:
/kind bug
/kind dependency
/kind cleanup
/kind documentation
/kind feature
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
What this PR does / why we need it:
This PR adds a new eviction requirement,
TargetHigherThanRequestsAndOOMthat users can set to only allow updater to evict Pods that have a container that has been OOM killed recently or is currently in terminated state due to OOM kill and has a recommendation for resource upscale.Our use case: we run customer workloads that are very sensitive to disruptions, so normally are only restarted within a set maintenance window. We still want to use VPA and are going to attempt to avoid need for restarts by adding a larger margin to the VPA recommendation. However, in cases where the workload does get OOM killed, we want to apply the recommendation immediately without waiting for the maintenance window.
Currently we have built our own evictions controller to achieve similar behaviour, however co-ordinating the behaviour of the controller with VPA updater, especially once we start using in-place updates will be difficult.
See #10174 for more context.
The new eviction requirement is gated behind a
EvictionRequirementOOMScaleUpalpha feature gate that needs to be set for admissions webhook and updater in order to use it.Which issue(s) this PR fixes:
<!--
Automatically closes linked issue when PR is merged.
Usage:
Fixes #<issue number>, orFixes (paste link of issue)._If PR is about
failing-tests or flakes, please post the related issues/tests in a comment and do not useFixes_-->
Fixes #10174
Special notes for your reviewer:
A few notes on implementation:
This differs from quick OOM logic in updater. Thinking about our specific use case it seemed to make sense to allow eviction if there has been an OOM kill and is an upscale + other requirements pass without also checking for duration, but checking for duration would also work for us, so not opinionated on changing this.
memoryresource. I could have added an admission validation and reject it forcpu, but it seemed that doing that would not add much user value.--evict-after-oom-thresholdflag/evictAfterOOMThresholdVPA field value with the 10 minute default for what counts as 'recent' OOM kill. This seemed to make sense because the updater also uses that value when calculating 'recent' for quick OOM here and I can't think of why someone would want different values for 'recent' in different places in updater.Does this PR introduce a user-facing change?
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
-->
``
release-noteTargetHigherThanRequestsAndOOMAdds a new eviction requirement,
, that restricts the updater to only evict Pods that have a container that has been recently OOM killed and has a resource upscale recommendation. This is an alpha feature, disabled by default. To enable it, set--feature-gates=EvictionRequirementOOMScaleUp=trueon both the admission-controller and the updater.
[Usage]: <https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/docs/examples.md#controlling-eviction-behavior-based-on-scaling-direction-and-resource>
docs
``
/area vertical-pod-autoscaler
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Summary
New Features
Added an alpha eviction requirement for scaling up a container’s memory when its recommendation exceeds its request and it has recently been OOMKilled, subject to other eviction requirements.
The feature is disabled by default and requires enabling its feature gate. The recent-OOM window can use a per-VPA setting or the default 10-minute threshold.
Documentation
* Added configuration guidance and examples, including feature-gate and recent-OOM requirements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->