← Back to Pull requests

Ignore unrelated Node label changes in the NVIDIADriver controller #3305

Closed
unknown closed this pull request without merging on Dec 03, 2026 20:24 UTC
View on GitHub
unknown unknown commented on Dec 02, 2026 06:05 UTC
Author

Issue

No separate issue. This supersedes #2683.

Description

The NVIDIADriver controller reconciled all NVIDIADrivers whenever any label on a GPU node changed, and it logged a line for each change. Other tools in the cluster can set many node labels that the operator never reads. Each of those changes still caused a full reconcile, about 30 API requests, and a status update.

With this change, the controller reconciles only when:

  • a node gains or loses its GPU labels,

  • a label that the driver setup reads changes (GPU present, driver owner, driver deploy labels, and the NFD OS and kernel labels), or

  • a label used in the nodeSelector of any NVIDIADriver changes. This includes NVIDIADrivers that do not own the node and NVIDIADrivers that are being deleted, because the node selector conflict check counts both.
  • Examples, for a GPU node (before this change, every one of these started a reconcile):

    | Node label change | Reconcile | Reason |
    |---|---|---|
    | A monitoring agent updates example.com/heartbeat | No | The operator does not read this label |
    | The node gains or loses its GPU labels, or nvidia.com/gpu.present changes | Yes | The node becomes or stops being a GPU node |
    | nvidia.com/gpu-operator.driver.owner changes | Yes | The node moves to another NVIDIADriver |
    | nvidia.com/gpu.deploy.driver changes | Yes | The driver DaemonSet selects nodes by this label |
    | An NFD OS or kernel label changes, for example kernel-version.full | Yes | It sets the node pool and the driver image |
    | region=us-east-1 is added, and some NVIDIADriver selects region | Yes | It can change the node's owner or create a node selector conflict, also for NVIDIADrivers that do not own the node |
    | The same, but that NVIDIADriver is being deleted | Yes | The node selector conflict check still counts it |

    A label change on a node without GPU labels does not start a reconcile, before or after this change.

    A label added with an empty value counts as a change. If the filter cannot list the NVIDIADrivers, it lets the update through instead of dropping it. A unit test checks that the node pool code reads no label outside the list: changing or removing any other label on a test node does not change the node pools. The node-labeling controller now uses the same nodeSelector check. The e2e test for node selector conflicts comes from #2683.

    Checklist

  • No secrets, sensitive information, or unrelated changes

  • Lint checks passing (make lint). The full run reports 3 findings in cmd/nvidia-validator/main.go, which this PR does not change.

  • Generated assets in-sync (make validate-generated-assets)

  • Go mod artifacts in-sync (make validate-modules)

  • Test cases are added for new code paths
  • Testing

    Unit tests: 17 cases for the new filter and a test for the label list.

    Scale test: a kind cluster with 200 simulated GPU nodes (kwok). A script changed one unrelated label on every node, at 10 changes per node per minute and then at 1 change per node per minute. Each run measured 6 minutes without changes and 6 minutes with changes. The table shows the difference between the two (the cost of the label changes). There was one run per image.

    | Driver setup | Changes per node per minute | Measurement | Before | After | Reduction |
    |---|---|---|---|---|---|
    | NVIDIADriver CRD | 10 | Operator CPU | 385m | 18m | 95% |
    | | | API requests per second | 142 | 0.04 | >99.9% |
    | | | NVIDIADriver reconciles per second | 4.3 | 0 | 100% |
    | | | Memory allocated per second | 272 MB | 8.3 MB | 97% |
    | NVIDIADriver CRD | 1 | Operator CPU | 284m | 2.5m | 99% |
    | | | API requests per second | 110 | 0.02 | >99.9% |
    | | | NVIDIADriver reconciles per second | 3.3 | 0 | 100% |
    | | | Memory allocated per second | 206 MB | 0.8 MB | 99.6% |
    | ClusterPolicy only | 10 | Operator CPU | 19.7m | 18.5m | 6% (within noise) |
    | | | Log lines per second from label changes | 34 | 0 | 100% |

    m = millicores (thousandths of one CPU core).

  • Before the change, at 10 changes per node per minute (33 changes per second for 200 nodes), the controller was busy all the time. It runs one reconcile at a time, and each reconcile took about 0.23 s. The work queue keeps at most one waiting request per NVIDIADriver. So all the changes that arrived during a reconcile were handled together by the next one. That is why the controller did only 4.3 reconciles per second, and why the CPU cost at 10 changes per node per minute (385m) is not ten times the cost at 1 change (284m).

  • After the change, the NVIDIADriver setup costs the same as the ClusterPolicy setup. The remaining cost, about 0.5 ms of CPU per Node update, is the operator receiving the Node update. This change does not affect it.

  • With ClusterPolicy only, no NVIDIADriver exists, so nothing was reconciled before the change either. Neither image made API requests for the label changes. The change only removes the log line for each label change.

  • After each NVIDIADriver CRD run, a check created two NVIDIADrivers that select the same label, and then set that label on one node. Both NVIDIADrivers reported the node selector conflict within 1 second. Both were ready again after the label was removed, and the node's driver owner did not change. Both images passed this check.
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: cdesiniotis Review duration: 2299m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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
    Real PR Conversation Timeline
    1 comments
    "Review active on #3305"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 20.5% · Safe to merge
    20.5%