VPA: Group aggregate containers to reduce recommender allocations #10661
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 443 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.365
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10661"
general
weight: 0.35
adrianmoisey
What type of PR is this?
<!--
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
-->
/kind feature
What this PR does / why we need it:
Group aggregate containers to reduce recommender allocations. Details on why I believe this is needed are in the issue https://github.com/kubernetes/autoscaler/issues/10660
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 #10660
Special notes for your reviewer:
In addition to the github issue I wanted to add a comparison from my local benchmarking test.
With the args
| Implementation | Time/op | container-visits/op | Allocated bytes/op | Allocations/op |
|--------|--------|--------|--------|--------|
| Baseline (existing) | 874.6 ms | 10,000,000 | 644 MB | 10,014,023 |
| Grouped Containers (this pr) | 31.4 ms | 20,000 | 5.05 MB | 29,022 |
With the changes this runs 27x faster.
The improvements look really good to me. Full VPA e2e tests all pass and all unit tests are passing. I can provide benchmarking code I used to support these results.
I am confident this should not cause any issues due to the unit tests and e2e tests passing.
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-noteReduce checkpoint computation resource usage by grouping containers.
docs
``
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Performance
Checkpoint updates reuse container information across autoscalers, reducing repeated processing when multiple autoscalers are checkpointed.
Bug Fixes
Checkpoint history correctly accounts for replicated containers that share an aggregate key and distinguishes containers with different labels, even when their names match.
* Recent memory peaks are excluded until their aggregation interval completes, then retained alongside older peaks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->