← Back to Pull requests

Honor GPUCluster DaemonSet update strategy #2958

Open
ajavanma opened this pull request with 159 lines diff across 6 files
View on GitHub
ajavanma ajavanma commented on Sep 23, 2026 00:41 UTC
Author

Description

Fixes https://github.com/NVIDIA/gpu-operator/issues/2957

GPUCluster accepts daemonsets.updateStrategy: OnDelete, but its DRA kubelet plugin, DRA validator, DCGM and DCGM exporter DaemonSets always render RollingUpdate. This can allow automatic pod replacement when the administrator requested manual replacement.

Render the configured update strategy directly in the four YAML templates using the existing Daemonsets render data. Omitted configuration still selects RollingUpdate. The DRA templates omit the complete rollingUpdate block for OnDelete, preserving maxUnavailable: "100%" for rolling updates. DCGM and DCGM exporter preserve their existing rolling-update defaults.

Readiness remains desired-state convergence: all desired pods must use the current template and be available. An OnDelete workload stays NotReady until manual replacement finishes; later operand states continue reconciling. No production readiness, API, dependency or NVIDIADriver changes.

Checklist

  • No secrets, sensitive information, or unrelated changes

  • Lint checks passing (GOOS=linux make lint; static analysis on macOS)

  • Generated assets in-sync (make validate-generated-assets) — not rerun; no API, generated-code or Helm changes

  • Go mod artifacts in-sync (make validate-modules) — not rerun; no dependency changes

  • Test cases are added for new code paths
  • Testing

  • All 20 real-operand rendering cases and 18 readiness cases pass on macOS ARM64 with Go 1.26.5.

  • Production changes and readiness coverage are byte-for-byte identical to the original template implementation at 3bdad2e3a5cbb3a54129a728f6f6339e14be4764; the retained renderer matrix adds four explicit RollingUpdate-with-settings controls.

  • make fmt, make license-check and make unit-test passed with Go 1.27.1 on macOS ARM64, including the full build and all 21 tested packages.

  • GOOS=linux make lint passed with zero issues using golangci-lint 2.13.1 and Go 1.27.1 on the Mac. This was static analysis for Linux, not Linux runtime testing.

  • No live Kubernetes or GPU hardware validation was rerun for this revision. Earlier cluster validation remains historical evidence in the contribution record.
  • Diff: 159 lines (+150 / -9) across 6 files Reviewer: tariq1890 Review duration: 41243m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.41) × (1 − Review Confidence (0.88)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.41 · 159 lines diff across 6 files
    0.41
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.91 · 4 substantive comment(s)
    0.91
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    87%
    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.304
    Real PR Conversation Timeline
    5 items
    copy-pr-bot[bot] copy-pr-bot[bot] commented on Sep 23, 2026 00:41 UTC
    Bot

    This pull request requires additional validation before any workflows can run on NVIDIA's runners.

    Pull request vetters can view their responsibilities here.

    Contributors can view more details about this message here.

    coderabbitai[bot] coderabbitai[bot] commented on Oct 05, 2026 08:13 UTC
    Bot

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- review_stack_entry_start -->

    <a href="https://app.coderabbit.ai/change-stack/NVIDIA/gpu-operator/pull/2958?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a>

    Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

    <!-- review_stack_entry_end -->
    <details>
    <summary>🧰 Additional context used</summary>

    <details>
    <summary>📚 Code guidelines (1)</summary>

    AGENTS.md — auto-discovered
    

    </details>

    </details>
    <!-- recent_review_start -->

    No actionable comments were generated in the recent review. 🎉

    <details>
    <summary>ℹ️ Recent review info</summary>

    <details>
    <summary>⚙️ Run configuration</summary>

  • Configuration used: Repository: NVIDIA/gpu-operator/.coderabbit.yaml

  • Review profile: QUIET

  • Plan: Enterprise

  • Run ID: fbbbb923-20fc-4a82-b706-9b6af1791ce6
  • </details>

    <details>
    <summary>📥 Commits</summary>

    Reviewing files that changed from the base of the PR and between 4fdfb1db7ddb87ba8969c52c634a5aeff104ab5f and 1ff825b8a1ceb3eb63beef9525ac0d1d7ee19a34.

    </details>

    <details>
    <summary>📒 Files selected for processing (5)</summary>

    internal/state/configurable_state.go
    internal/state/daemonsets_test.go
    internal/state/dra_driver.go
    internal/state/gpucluster.go

  • internal/state/state_skel_test.go
  • </details>

    Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

    </details>

    ---

    <!-- recent_review_end -->
    <!-- walkthrough_start -->

    <details>
    <summary>📝 Walkthrough</summary>

    Walkthrough

    GPUCluster component render paths now use a shared renderer that applies the configured DaemonSet update strategy. An empty strategy defaults to RollingUpdate. OnDelete removes rollingUpdate settings. Tests cover strategy output across four states, newly rendered operands, and DaemonSet readiness under both strategies.

    </details>

    <!-- walkthrough_end -->
    <!-- change_assessment_start -->
    Priority: ➖ Normal

    <!-- change_assessment_commit:"1ff825b8a1ceb3eb63beef9525ac0d1d7ee19a34" -->
    Severity of issue fixed: Medium
    <!-- change_assessment_end -->
    <!-- final_review_risk_start -->
    Merge Risk: _⚪ Minimal_ · up to 1ff82
    <!-- final_review_risk_coverage:{"sourceCommitId":"1ff825b8a1ceb3eb63beef9525ac0d1d7ee19a34","coveredCommitId":"1ff825b8a1ceb3eb63beef9525ac0d1d7ee19a34","kind":"reviewed"} -->

    The strategy and readiness changes have no identified merge-blocking issue. The existing operand defaults and OnDelete readiness checks should remain as implemented.
    <!-- final_review_risk_end -->
    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autopilot</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- tips_start -->

    ---

    <sub>Comment @coderabbitai help to get the list of available commands.</sub>

    <!-- tips_end -->

    tariq1890 tariq1890 commented on code on Oct 05, 2026 17:35 UTC
    Code Review
    internal/state/gpucluster.go:1
    @@ -29,6 +31,34 @@ import (
     
     // Helpers shared by the GPUCluster operand states (DRA driver, DCGM, ...).
     
    +// renderGPUClusterObjects applies common GPUCluster policy after rendering so
    +// each operand does not need to implement it in its templates.
    +func (s *stateSkel) renderGPUClusterObjects(ctx context.Context, cr *nvidiav1alpha1.GPUCluster, data any) ([]*unstructured.Unstructured, error) {

    This is not correct. We should be updating the yaml templates to set the daemonset update strategy

    ajavanma ajavanma commented on code on Oct 05, 2026 18:07 UTC
    Code Review
    internal/state/gpucluster.go:1
    @@ -29,6 +31,34 @@ import (
     
     // Helpers shared by the GPUCluster operand states (DRA driver, DCGM, ...).
     
    +// renderGPUClusterObjects applies common GPUCluster policy after rendering so
    +// each operand does not need to implement it in its templates.
    +func (s *stateSkel) renderGPUClusterObjects(ctx context.Context, cr *nvidiav1alpha1.GPUCluster, data any) ([]*unstructured.Unstructured, error) {

    Thanks @tariq1890. I moved this into the shared renderer following the discussion in #2957 so future GPUCluster DaemonSets would inherit the same update-strategy handling. If I understand your point correctly, the templates should express the desired DaemonSet spec directly, without a second step that overrides it in Go. That makes sense to me. I have moved the handling back into the four templates while preserving the existing defaults and regression coverage.

    Reviewers
    Assignees
    ajavanma ajavanma
    Labels
    risk: low confidence: 87.8% 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: 40.7% (MEDIUM) · Higher = larger blast radius
    40.7%
    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: 87.8% · Lower = rushed or shallow review
    87.8%
    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: 5.0% · Safe to merge
    5.0%