Skip to content

Set MaintenanceInProgress status condition during approved maintenance - #212

Draft
afritzler wants to merge 1 commit into
ironcore-dev:mainfrom
afritzler:enh/node-maintenance
Draft

afritzler wants to merge 1 commit into
ironcore-dev:mainfrom
afritzler:enh/node-maintenance

Conversation

@afritzler

@afritzler afritzler commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Proposed Changes

Summary

The node reconciler now writes a MaintenanceInProgress condition into node.status.conditions while a maintenance is approved and still needed, and removes it once the maintenance is over. MaintenanceInProgress is one of the five well-known Node lifecycle conditions introduced in Kubernetes v1.37 (see the Kubernetes blog post and KEP-5683). Until now the state of an ongoing maintenance was only visible by correlating labels on the ServerClaim in the metal cluster with labels on the node in the target cluster. Anything that just looks at the node (people, dashboards, and eventually core components like the DaemonSet controller) can now read it directly. Publishing these conditions today does not require the NodeLifecycleConditions feature gate: in v1.37 the gate is a no-op, and administrators or their controllers are expected to own the writes.

How the flow works

flowchart LR
    subgraph metal cluster
        Claim["ServerClaim labels"]
    end
    subgraph target cluster
        NodeLabels["Node labels"]
        NodeStatus["Node status conditions"]
    end

    Claim -- "maintenance-needed=true" --> NodeLabels
    NodeLabels -- "workload controller adds maintenance-approved=true" --> NodeLabels
    NodeLabels -- "reconciler syncs approval back" --> Claim
    NodeLabels -- "approved and needed" --> NodeStatus["MaintenanceInProgress=True<br/>reason: PlannedMaintenance"]
    Claim -- "maintenance-needed removed" --> NodeLabels
    NodeLabels -- "no longer needed" --> NodeStatusGone["condition removed"]
Loading

Walking through it:

  1. The metal operator sets metal.ironcore.dev/maintenance-needed=true on the ServerClaim. The ServerClaim reconciler copies the label onto the matching node (found through the node's spec.providerID field index).
  2. A third-party controller that controls the workloads in the target cluster approves the maintenance by labeling the node metal.ironcore.dev/maintenance-approved=true. The node reconciler syncs that approval back onto the ServerClaim. Once the approval has landed there and the maintenance is still needed, the same reconciler sets status.conditions[MaintenanceInProgress] on the node with status=True and reason=PlannedMaintenance.
  3. When the maintenance is done, the maintenance-needed label goes away. The reconcile strips the approval from the claim and removes the node condition in the same pass. Removal instead of parking it at False is one of the two options the v1.37 guidance suggests, and a condition whose reason no longer exists should not exist either.
  4. If maintenance is needed but nobody approved it yet, the node gets no condition at all.

This also follows the blog's recommended pattern overall: the labels and the approval handshake remain the mechanism that drives the maintenance, the condition only reports its state.

Caveat

This mapping between ServerClaim state and node labels currently lives inside the CCM. That is convenient for now but it is not really the CCM's job in the long run, and it should eventually be factored out into a dedicated controller project.

@afritzler afritzler changed the title node: Set MaintenanceInProgress status condition during approved maintenance Set MaintenanceInProgress status condition during approved maintenance Nov 10, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Nov 10, 2026
@afritzler afritzler changed the title Set MaintenanceInProgress status condition during approved maintenance Set MaintenanceInProgress status condition during approved maintenance Nov 10, 2026
…tenance

Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/metal-automation Automation processes within the Metal project. enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants