feat(node-drainer): read the device scope of partial drains from configuration #2477
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #2477"
general
weight: 0.35
KaivalyaMDabhadkar
Summary
Part of #2247. This is the first part of ADR-071 (#2417). It adds the [configuration](docs/designs/071-device-scope-from-configuration.md#configuration) and the node-drainer side of the [partial drain decision](docs/designs/071-device-scope-from-configuration.md#partial-drain-decision).
Today, partial drains only know about GPUs: the entity type is always
GPU_UUID, and the only scoped action isCOMPONENT_RESET. This PR moves both into configuration, so an operator can add another device type and choose which actions drain only the pods that use it.Changes
global.partialRemediationEntityTypeslists the entity types that get partial drains. Each type has its devices (device-plugin resource names, or a DRA driver with its DeviceClasses and the ResourceSlice attribute that holds the entity value) and its scoped actions. The default is today'sGPU_UUIDentry withCOMPONENT_RESET, and the chart holds the only copy of it. node-drainer fails to start if its config has nopartialRemediationEntityTypeskey. The umbrella chart validates the map at install, and node-drainer validates it again at startup.scopedActionsof an entity type. If the event has no entity of that type, the drain is retried, so a fix to the configuration lets it continue.drainGPUPodsnow looks for devices of every configured entity type.preUpgradeEntityTypes): onlyCOMPONENT_RESETonGPU_UUIDgot a partial drain. This rule does not follow the configuration.Behaviour changes with the default configuration
COMPONENT_RESETevent with noGPU_UUIDentity is now retried. Before, the drain failed and the node gotdrain-failed.Not in this PR
impactedEntityScopeagainst the map, the run-time scope check, and the install check (ADR-071 decision 3). It should ship in the same release as this PR, because this PR lets a custom action get a partial drain.Testing
Manual test on a local kind cluster (Tilt) with 3 KWOK nodes.
Setup
The Helm values add one entity type next to the default
GPU_UUID:config.tomland started without restarts.accel-test, which uses theImmediateeviction mode.dgxc.nvidia.com/devicesannotations by hand. The pods have no ResourceClaims. A pod "uses DRA" here when its annotation lists the device under the driver nameaccel.example.com.There are 10 pods, one group on each node:
| Node | Pod | Container limit | Device annotation |
|---|---|---|---|
| kwok-node-0 |
s1-target-plugin|example.com/accel|example.com/accel: [ACC-1]|| kwok-node-0 |
s1-target-dra| none |accel.example.com: [ACC-1]|| kwok-node-0 |
s1-other-accel| none |accel.example.com: [ACC-2]|| kwok-node-0 |
s1-gpu-same-value|nvidia.com/gpu|nvidia.com/gpu: [ACC-1]|| kwok-node-0 |
s1-plain| none | none || kwok-node-1 |
s2-stale|example.com/accel|nvidia.com/gpu: [GPU-X], no entry forexample.com/accel|| kwok-node-1 |
s2-target|example.com/accel|example.com/accel: [ACC-9]|| kwok-node-2 |
s3-target|nvidia.com/gpu|nvidia.com/gpu: [GPU-1]|| kwok-node-2 |
s3-other-gpu|nvidia.com/gpu|nvidia.com/gpu: [GPU-2]|| kwok-node-2 |
s3-plain| none | none |Results
1. Custom action on the new type (kwok-node-0). A
CUSTOMeventaccel-resetforACCEL_SERIAL=ACC-1evicteds1-target-pluginands1-target-dra. The other three pods kept running, includings1-gpu-same-value, which has the same value under a GPU resource name. The node reacheddrain-succeeded.2. Missing annotation entry (kwok-node-1). An
accel-resetevent forACCEL_SERIAL=ACC-9held the drain, becauses2-stalerequestsexample.com/accelbut its annotation has no entry for it. Nothing was evicted, and node-drainer retried with "pod s2-stale is requesting resource example.com/accel but its device annotation has no entry for it". After I addedexample.com/accel: [ACC-8]to the annotation ofs2-stale, node-drainer evicteds2-target, lefts2-stalerunning, and the node reacheddrain-succeeded.3. Default GPU path (kwok-node-2). A
COMPONENT_RESETevent forGPU_UUID=GPU-1evicted onlys3-target.s3-other-gpuands3-plainkept running.helm templateshowed thatGPU_UUID: nullin user values does not remove the default entry from the node-drainer subchart. The values comment and the docs therefore say to setGPU_UUID.scopedActions: []instead.Type of Change
Component(s) Affected
Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Partial draining supports configurable device types and remediation actions; GPU component resets remain the default.
Device-plugin and DRA requests help identify affected workloads during partial and GPU-only drains.
Previously recorded drain decisions retain their original scope when configuration changes.
Bug Fixes
Events missing required entity or device details are retried instead of being marked as drain failures or incorrectly matched.
Remediation actions that do not match a recorded partial-drain scope are retried rather than applied to a different device.
Invalid or missing partial-drain configuration is rejected during startup or chart rendering.
Documentation
Updated guidance covers device mappings, scoped actions, configuration validation, and GPU-only draining.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->