← Back to Pull requests

feat(lifecycle-manager): add Helm chart support for MaintenanceRequest [3/3] #1735

Closed
unknown closed this pull request without merging on Sep 21, 2026 20:15 UTC
View on GitHub
unknown unknown commented on Sep 02, 2026 22:58 UTC
Author

Summary

Helm chart changes to deploy the MaintenanceRequest feature introduced in Part 1 and Part 2, plus the platform-connector authentication the feature needs in order to work at all. Gated behind controllers.maintenanceRequest.enabled (defaults to false, opt-in).

Part 3 of 3. Parts 1 and 2 are merged; this branch is rebased onto current main.

Why authentication is in scope here

A MaintenanceRequest may name any node, but lifecycle-manager is a Deployment running on one node. platform-connector pins a publisher to its own node unless that publisher is on the cross-node allowlist and presents a ServiceAccount token minted for the configured audience.

Without both halves the failure is silent: the MR is admitted, its HealthEventEmitted condition goes True, and the node simply never cordons, with the rejection visible only as a node_mismatch counter on platform-connector.

What's included

Feature deployment

  • ClusterRole — RBAC for maintenancerequests, maintenancerequests/status, maintenancerequests/finalizers, and node annotation access

  • Deployment — --enable-maintenance-controller and --platform-connector-socket flags, platform-connector socket volume mount

  • Webhook — validating webhook configuration for MaintenanceRequest

  • Values — controllers.maintenanceRequest.enabled, documented inline
  • Platform-connector authentication

  • Chart-local pcAuth helpers — copied from kubernetes-object-monitor, named lifecycle-manager. so the subchart renders standalone without overriding the umbrella's nvsentinel. definitions

  • Deployment — --platform-connector-token-path plus the projected ServiceAccount token volume and mount, nested inside the existing feature gate

  • Umbrella — derives system:serviceaccount:<namespace>:lifecycle-manager into AuthCrossNodeServiceAccounts
  • Quarantine rule — fault-quarantine ruleset matching the maintenanceRequestName metadata key that the mutating webhook stamps on every MR-originated event

    Tests — 3 helm-unittest suites (8 tests) and an E2E covering create-to-cordon and delete-to-uncordon

    Docs — docs/configuration/lifecycle-manager.md, cross-referencing [authentication.md](docs/configuration/authentication.md)

    Design notes for reviewers

    The allowlist entry is gated on the subchart's own value, lifecycle-manager.controllers.maintenanceRequest.enabled, read from the umbrella via .Values["lifecycle-manager"] — not on a new global key. One switch drives both the credential and the grant, so they cannot be enabled independently. A second switch is precisely how you end up with a pod holding a valid token that the connector has never heard of.

    The ServiceAccount name is derived, not written out. It resolves to a fixed lifecycle-manager only because the subchart ships fullNameOverride; overriding that or serviceAccount.name would otherwise leave the allowlist naming an identity that does not exist. Same class of bug as the hardcoded namespace the derived list already exists to prevent.

    The two halves cannot be asserted in one test. The umbrella suite runs with --with-subchart=false, so a subchart template is not selectable from it. Both suites are keyed on the same value instead, with a comment explaining why they are apart.

    Enabling this rolls platform-connector cluster-wide, because the allowlist lives in its ConfigMap and that ConfigMap's checksum is stamped on the DaemonSet pod template. True of enabling any cross-node publisher, but worth scheduling deliberately. Documented.

    Backwards compatible. With global.platformConnectorAuth.enabled=false, the rendered Deployment is byte-identical to before this change (verified by diff).

    Type of Change


  • Bug fix

  • New feature

  • Breaking change

  • Documentation

  • Refactoring

  • Build/CI
  • Component(s) Affected


  • Core Services

  • Documentation/CI

  • Fault Management

  • Health Monitors

  • Janitor

  • Other: lifecycle-manager Helm chart
  • Testing

  • Tests pass locally

  • Manual testing completed

  • No breaking changes (or documented)
  • Automated

    | Gate | Result |
    |---|---|
    | make helm-lint | Pass |
    | make helm-test | Pass — 8 new tests across 3 suites |
    | make license-headers-lint | Pass |
    | make gomod-lint | Pass — 33 modules |
    | make -C tests lint-test | Pass — 0 issues |
    | make -C lifecycle-manager lint-test | Pass |

    The allowlist test was mutation-checked: removing the MaintenanceRequest condition from the gate (the exact mistake someone would make while tidying that entry into the table with the other five) fails must not allowlist lifecycle-manager when the MR controller is disabled by name.

    Switch matrix

    Rendered for all four combinations. The token's three pieces appear only when both switches are on:

    | MaintenanceRequest | Auth | Token in pod |
    |---|---|---|
    | on | on | flag, mount, volume |
    | on | off | none |
    | off | on | none |
    | off | off | none |

    Live Cluster Testing

    Tested on nvs-dgxc-k8s-azr-scus-dev1 using candidate b224f566.

  • All upgraded workloads became healthy: MongoDB 3/3, platform-connectors 29/29, and lifecycle-manager 1/1.

  • Created an MR for a node different from the lifecycle-manager node.

  • The webhook replaced the requester agent with lifecycle-manager and preserved the original agent in event metadata.

  • platform-connector verified lifecycle-manager’s ServiceAccount token and authorized both the opening and clearing events as cross-node requests.

  • The opening event cordoned the target node.

  • Pod eviction was intentionally skipped using drainOverrides.skip=true.

  • Deleting the MR published the clearing event and uncordoned the node.

  • Invalid requests—including a healthy opening event, missing node, past start time, missing version, and spoofed agent metadata—were correctly rejected or sanitized.

  • Rolled back to NVSentinel v1.16.0; all workloads recovered and no test resources remained.
  • Checklist


  • Self-review completed

  • Documentation updated (if needed)

  • Ready for review
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

  • New Features

  • - Added opt-in MaintenanceRequest support to Lifecycle Manager, including validation, health-event publishing, node targeting, and platform-connector authentication.
    - Added quarantine rules that cordon affected nodes and restore them after maintenance completes.
    - Added cross-node authorization for maintenance events.
  • Bug Fixes

  • - Validation webhooks now process only create and update operations.
  • Documentation

  • - Added Lifecycle Manager configuration guidance, authentication details, examples, and quarantine behavior.
  • Tests

  • - Added coverage for deployment, permissions, authentication, cross-node authorization, and the end-to-end MaintenanceRequest lifecycle.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: cbumb Review duration: 27196m
    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 #1735"
    general weight: 0.35
    Reviewers
    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%