vpa: add TargetConflict status condition for VPAs targeting the same object #10253
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.57) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 561 lines diff across 7 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.379
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #10253"
general
weight: 0.35
yashrajshuklaaa
/kind feature
What this PR does / why we need it:
If multiple VPAs with an active update mode target the same workload, the admission controller and updater can end up acting on the same pod in different ways. One VPA can try an in-place resize while another evicts the pod.
This adds a
TargetConflictstatus condition so this configuration is visible on the VPA.How it works:
Stronger()picks the controlling VPA (oldest creation time, then name). This is the same logic the admission controller and updater use to choose a VPA for a pod.TargetConflict=True, with a message naming the controlling VPA. The controlling VPA is not modified.Offare ignored, unless they have astartupBoostconfigured, since those still act on pods.InitialandAutocount as active.Off, or notargetRef).observedGenerationis set on the condition.status.conditions, so it does not touch the recommendation fields owned by the recommender. The patch is guarded with a JSON Patchtestop on the existing conditions and retried (up to 3 times, on top of freshly fetched conditions) if another writer changed them in between.RBAC:
verticalpodautoscalers/status. I added the updater service account to the existingsystem:vpa-status-actorClusterRoleBinding indeploy/vpa-rbac.yaml.recommender.enabled.Other:
vpaClientin the updater is nowvpa_clientset.Interfaceso the fake client can be used in tests.Which issue(s) this PR fixes:
Fixes #10135
Special notes for your reviewer:
Stronger()picks a single VPA per pod regardless of the containers or resources each VPA controls, so this was replaced with controlling-VPA selection.Chart.yamlis not bumped in this PR; it needs a bump before the next release (per discussion).Does this PR introduce a user-facing change?
``
release-noteTargetConflictAdded a
status condition on VerticalPodAutoscaler objects. When multiple VPAs with an active update mode target the same workload, the oldest VPA controls it, and the others getTargetConflict=Truenaming the controlling VPA. The updater also emits a Warning event when the conflict starts. The VPA updater now requires permission to patchverticalpodautoscalers/status; the provided deploy manifests and Helm chart are updated.
`Tests
Table-driven tests in target_conflict_test.go
, each also run with reversed input order:counts as active,Offis ignored,OffwithstartupBoostis active.or lost itstargetRef.gofmt
,go build,go vetand thepkg/updater/...` tests pass.