Add safe-to-evict=on-completion #9355
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 301 lines diff across 3 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.342
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #9355"
general
weight: 0.35
x13n
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
This PR introduces the
cluster-autoscaler.kubernetes.io/safe-to-evict: "on-completion"annotation value. It allows users to specify that a pod should not be actively evicted by the Cluster Autoscaler during a scale-down event, but rather should be allowed to run to completion.When scaling down, the Cluster Autoscaler will wait for pods with this annotation to complete successfully rather than forcefully evicting them. Nodes containing only daemonset pods and "on-completion" pods are prioritized for scale-down after completely empty nodes, but before nodes requiring active pod eviction.
This is particularly useful for AI/ML workloads or batch jobs that cannot be easily interrupted or checkpointed, ensuring they finish their computation naturally before the underlying node is scaled down.
Special notes for your reviewer:
PR adds a new drainability rule
oncompletionwhich skips pods annotated withcluster-autoscaler.kubernetes.io/safe-to-evict=on-completion. To surface this state cleanly to the rest of the CA logic, thesimulator.GetPodsToMovefunction was refactored to return aPodMoveInfostruct rather than multiple slice return values. This cleans up the signature and allows better handling of special pod categories likeOnCompletionPods.The
ScaleDownNodeProcessorsorting logic is also updated to prioritize nodes with only on-completion pods right after completely empty nodes.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-notecluster-autoscaler.kubernetes.io/safe-to-evict: "on-completion"Introduced
annotation value. Pods with this annotation will not be forcefully evicted during node scale-down; instead, the Cluster Autoscaler will wait for them to natively run to completion before scaling down the node. Nodes with only these pods are prioritized for scale-down over nodes with standard pods requiring eviction.
``