← Back to Pull requests

feat(node-drainer): read the device scope of partial drains from configuration #2477

Closed
unknown closed this pull request without merging on Nov 24, 2026 16:01 UTC
View on GitHub
unknown unknown commented on Nov 20, 2026 08:14 UTC
Author

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 is COMPONENT_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

  • Configuration. global.partialRemediationEntityTypes lists 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's GPU_UUID entry with COMPONENT_RESET, and the chart holds the only copy of it. node-drainer fails to start if its config has no partialRemediationEntityTypes key. The umbrella chart validates the map at install, and node-drainer validates it again at startup.

  • When a drain is partial. node-drainer runs a partial drain when the event's effective action, including a custom action name, is in the scopedActions of 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.

  • Which pods are evicted. The pod filter looks for the entity value under the resource names and DRA drivers of the entity type. If a pod requests a device of the type and its annotation has no entry for it, the drain waits and retries. Before, this check only covered pods with no annotation at all. For DRA, node-drainer reads the pod's ResourceClaims only when the annotation is missing a driver of the type, and it uses the drivers of the claim's allocation.

  • drainGPUPods now looks for devices of every configured entity type.

  • Events from before the upgrade. An event without a recorded drain decision was drained before the map existed, so the already-drained check works out its scope from the rule of those versions (preUpgradeEntityTypes): only COMPONENT_RESET on GPU_UUID got a partial drain. This rule does not follow the configuration.
  • Behaviour changes with the default configuration

  • A pod whose annotation has no entry for a GPU resource or DRA driver that it requests now makes the partial drain wait and retry. One example is a DRA pod whose GPU the mapper cannot resolve (#2454). Before, the drain went on and could miss the pod.

  • A COMPONENT_RESET event with no GPU_UUID entity is now retried. Before, the drain failed and the node got drain-failed.
  • Not in this PR

  • fault-remediation: checking impactedEntityScope against 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.

  • The pod device mapper: recording the configured names and drivers, and reading DRA identity from ResourceSlices (decision 4). Until then, an operator can configure another entity type, but its partial drains wait for annotation entries. The docs say so.
  • Testing


  • Tests pass locally

  • Manual testing completed

  • No breaking changes (or documented)
  • 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:

    global:
      partialRemediationEntityTypes:
        ACCEL_SERIAL:
          devices:
            - resourceNames: ["example.com/accel"]
            - driver: accel.example.com
              deviceClasses: ["accel.example.com"]
              entityValueAttribute: serial
          scopedActions: ["accel-reset"]
    

  • node-drainer read both entity types from the rendered config.toml and started without restarts.

  • fault-remediation was scaled to 0, so no remediation ran after a drain.

  • The test pods run in the namespace accel-test, which uses the Immediate eviction mode.

  • The mapper does not record the new type yet, so I wrote the dgxc.nvidia.com/devices annotations by hand. The pods have no ResourceClaims. A pod "uses DRA" here when its annotation lists the device under the driver name accel.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 for example.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 CUSTOM event accel-reset for ACCEL_SERIAL=ACC-1 evicted s1-target-plugin and s1-target-dra. The other three pods kept running, including s1-gpu-same-value, which has the same value under a GPU resource name. The node reached drain-succeeded.
    2. Missing annotation entry (kwok-node-1). An accel-reset event for ACCEL_SERIAL=ACC-9 held the drain, because s2-stale requests example.com/accel but 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 added example.com/accel: [ACC-8] to the annotation of s2-stale, node-drainer evicted s2-target, left s2-stale running, and the node reached drain-succeeded.
    3. Default GPU path (kwok-node-2). A COMPONENT_RESET event for GPU_UUID=GPU-1 evicted only s3-target. s3-other-gpu and s3-plain kept running.

    helm template showed that GPU_UUID: null in user values does not remove the default entry from the node-drainer subchart. The values comment and the docs therefore say to set GPU_UUID.scopedActions: [] instead.

    Type of Change


  • 🐛 Bug fix

  • ✨ New feature

  • 💥 Breaking change

  • 📚 Documentation

  • 🔧 Refactoring

  • 🔨 Build/CI
  • Component(s) Affected


  • Health Monitor

  • Core Service

  • Fault Management

  • Janitor

  • Deployment/Config

  • API/Interface

  • Preflight

  • Plugins

  • Documentation/CI

  • New Component

  • Multiple Components

  • Other
  • Checklist


  • Self-review completed

  • Documentation updated (if needed)

  • Ready for review
  • <!-- 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 -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: KaivalyaMDabhadkar Review duration: 6226m
    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
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.7% · Safe to merge
    29.7%