Skip to content

Kind · metal.platform-kit.org/v1alpha1

MaintenanceWindow

A MaintenanceWindow tells the operator when work that disturbs a machine can start. You write it. A person must still approve each change. The window only sets the time when an approved change starts.

Group and version
metal.platform-kit.org/v1alpha1
Scope
Cluster.
Written by
You. The operator writes the status.
Reconciled by
MaintenanceWindow controller writes the status. HostOperation controller applies the window.
Covers
Hosts, by label or by the cluster of their node.
Delays
The start of an approved HostOperation.
Phases
None. Read status.open and the condition Valid.
Source
maintenancewindow_types.go

An operation and its maintenance window

1 / 6

An approved HostOperation waits until a MaintenanceWindow opens. Then it starts, and it continues after the window closes.YouHostOperationAwaitingApprovalMaintenanceWindowclosedMachineno changeapprovesopen?does the actions

Approve

You approve an operation on a machine that a window covers. The window is closed.

pk-metal approve pk-metal/<operation>
  1. Approve. You approve an operation on a machine that a window covers. The window is closed.

    pk-metal approve pk-metal/<operation>
  2. Wait. Before the first action, the operator examines the windows. No window is open. The operation waits.

    BLOCKED OutsideMaintenanceWindow
  3. Open. The window opens. The operator examines the windows again at that time.

    kubectl get maintenancewindows
  4. Start. The operation starts. No person is necessary for this step.

  5. Close. The window closes. The operation continues, because the operator examines the windows only before the start.

  6. Done. The operation comes to its end. The next approved operation waits for the next window.

The executor examines the windows one time for each operation, before the first action. It calculates the result from the spec of each window. It does not read status.open. When you change a window, an operation that waits uses the new window in 5 minutes or less.

No window, no delay
A machine that no window covers is not delayed. With no MaintenanceWindow objects, the operator works as before.
One open window is enough
When more than one window covers a machine, the operation starts when one of them is open.
A window delays only the start
The operator does not stop an operation when the window closes. A machine with half of a change is in a worse condition.
A new install does not wait
An operation with the reason Provisioning starts immediately. The machine has no workload yet.
A wrong window stays closed
If the operator cannot read a window, that window is never open. The machines that it covers wait until you correct it.
An approval is always necessary
A window does not approve an operation. An operation with no approval does not start in an open window.

All changes that go through a HostOperation wait for the window: BIOS and firmware changes, reboots, releases, and each node of a TalosRollout. A rollout that comes to a node outside its window waits there, between two nodes.

A window covers a Host when one of these is true:

The labels are the same labels that profiles use: metal.platform-kit.org/vendor, metal.platform-kit.org/model, and the labels of the HostClaim. A window must have a selector, a list of clusters, or the two.

weekly
A window on the given days, from start (local time, HH:MM) for duration. It can continue after midnight. The duration is 1 minute to 1 week.
once
One window from start to end, as full timestamps with an offset.
timeZone
The IANA time zone of the weekly windows, for example Europe/Berlin. The default is UTC. A weekly window keeps its local start time through a change to or from daylight saving time.

A window must have one weekly or one once entry at a minimum.

Rules for the whole spec (the API server refuses a change that breaks one):

  • name the machines: hostSelector, clusters, or both
  • give at least one weekly or once window
FieldTypeDescription
clusters[]stringClusters names TalosClusters (os.platform-kit.org): a Host whose node belongs to one of them is covered. A Host is covered when it matches the selector or runs a node of a named cluster.Bounds: at most 64 items
hostSelectorobjectHostSelector selects Hosts by label, the same labels profiles match (metal.platform-kit.org/vendor, metal.platform-kit.org/model, and the claim's own labels). An empty selector ({}) selects every Host.
matchExpressions[]objectLabel requirements that the object must meet. All must match.
keyrequiredstringThe label key.
operatorrequiredstringIn, NotIn, Exists or DoesNotExist.
values[]stringThe values for In and NotIn. Exists and DoesNotExist take no values.
matchLabelsmap[string]stringLabels that the object must have, as key and value pairs. All must match.
once[]objectOnce are single windows, for a planned intervention outside the usual schedule.Bounds: at most 32 items
  • Rule: end must be after start
endrequiredstring (date-time)End is when it closes.
startrequiredstring (date-time)Start is when the window opens (RFC 3339, with its offset).
timeZonestringTimeZone is the IANA time zone the weekly windows are read in, such as Europe/Berlin; daylight saving time is followed. Default UTC.Default: UTC
weekly[]objectWeekly are windows that recur every week.Bounds: at most 32 items
daysrequired[]stringDays are the days the window opens on, in the window's time zone.MonTueWedThuFriSatSunBounds: 1 to 7 items
durationrequiredstringDuration is how long the window stays open, such as 4h or 90m: at least a minute, at most a week. A window may run past midnight.
startrequiredstringStart is the local time the window opens, as HH:MM (24-hour clock).Pattern: ^([01][0-9]|2[0-3]):[0-5][0-9]$

The status is for people and for kubectl. The MaintenanceWindow controller writes it again each time the window opens or closes.

FieldTypeDescription
conditions[]objectConditions: Valid is False when the time zone or the selector cannot be read. An invalid window still covers the hosts that it can name, and it is never open. Thus a mistake in a window stops work and does not let it run.
nextChangestring (date-time)NextChange is when Open flips next: the close of the window that is open, or the start of the next one. Empty when no window comes again.
openbooleanOpen is true while one of the windows is open.

Columns of kubectl get maintenancewindows (the columns marked wide show only with -o wide):

ColumnValue
NAME.metadata.name
OPEN.status.open
NEXT CHANGE.status.nextChange
ZONE.spec.timeZone
AGE.metadata.creationTimestamp
Condition Status Reason Meaning
Valid True WindowValid The operator can read the window.
Valid False WindowInvalid The time zone, a weekly entry or the selector is wrong. The message gives the cause. The window is never open.

An operation that waits has the condition Executed with the status Unknown and the reason OutsideMaintenanceWindow. Its phase is Proposed, and blockedOn shows the reason. The message gives the time when the next window opens.

apiVersion: metal.platform-kit.org/v1alpha1
kind: MaintenanceWindow
metadata:
name: compute-weekend
spec:
hostSelector:
matchLabels:
role: compute
clusters: [prod]
timeZone: Europe/Berlin
weekly:
- days: [Sat]
start: "22:00"
duration: 6h
- days: [Tue, Thu]
start: "06:00"
duration: 90m
once:
- start: "2026-12-03T18:00:00+01:00"
end: "2026-12-03T23:00:00+01:00"
Terminal window
$ kubectl get maintenancewindows
NAME OPEN NEXT CHANGE ZONE AGE
compute-weekend false 2d Europe/Berlin 5d

Use this procedure for an urgent change, for example a security correction.

  1. Find the operation that waits. The column BLOCKED shows OutsideMaintenanceWindow.

    Terminal window
    kubectl get hostoperations -n pk-metal -o wide
  2. Set the annotation on the operation. Give your username and the reason as the value.

    Terminal window
    kubectl annotate hostoperation -n pk-metal <operation> metal.platform-kit.org/ignore-window="<username>: urgent security correction"
  3. Make sure that the phase of the operation is Running.

    Terminal window
    kubectl get hostoperation -n pk-metal <operation>

The operation starts on the next pass of the operator, in a few seconds. The reason stays in the record of the operation. You can set the annotation before or after the approval. The operation does not start without the approval.