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.
At a glance
Section titled “At a glance”- 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.openand the conditionValid. - Source
- maintenancewindow_types.go
How it works
Section titled “How it works”An operation and its maintenance window
1 / 6
Approve
You approve an operation on a machine that a window covers. The window is closed.
pk-metal approve pk-metal/<operation>Approve. You approve an operation on a machine that a window covers. The window is closed.
pk-metal approve pk-metal/<operation>Wait. Before the first action, the operator examines the windows. No window is open. The operation waits.
BLOCKED OutsideMaintenanceWindowOpen. The window opens. The operator examines the windows again at that time.
kubectl get maintenancewindowsStart. The operation starts. No person is necessary for this step.
Close. The window closes. The operation continues, because the operator examines the windows only before the start.
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
Provisioningstarts 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.
Which machines a window covers
Section titled “Which machines a window covers”A window covers a Host when one of these is true:
- The labels of the Host agree with
spec.hostSelector. An empty selector ({}) covers all Hosts. - The Host runs a node of a TalosCluster in
spec.clusters.
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.
When a window is open
Section titled “When a window is open”weekly- A window on the given days, from
start(local time,HH:MM) forduration. It can continue after midnight. The duration is 1 minute to 1 week. once- One window from
starttoend, as full timestamps with an offset. timeZone- The IANA time zone of the weekly windows, for example
Europe/Berlin. The default isUTC. 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
| Field | Type | Description |
|---|---|---|
clusters | []string | Clusters 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. |
hostSelector | object | HostSelector 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 | []object | Label requirements that the object must meet. All must match. |
keyrequired | string | The label key. |
operatorrequired | string | In, NotIn, Exists or DoesNotExist. |
values | []string | The values for In and NotIn. Exists and DoesNotExist take no values. |
matchLabels | map[string]string | Labels that the object must have, as key and value pairs. All must match. |
once | []object | Once are single windows, for a planned intervention outside the usual schedule.
|
endrequired | string (date-time) | End is when it closes. |
startrequired | string (date-time) | Start is when the window opens (RFC 3339, with its offset). |
timeZone | string | TimeZone is the IANA time zone the weekly windows are read in, such as Europe/Berlin; daylight saving time is followed. Default UTC. |
weekly | []object | Weekly are windows that recur every week. |
daysrequired | []string | Days are the days the window opens on, in the window's time zone.MonTueWedThuFriSatSun |
durationrequired | string | Duration 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. |
startrequired | string | Start is the local time the window opens, as HH:MM (24-hour clock). |
Status
Section titled “Status”The status is for people and for kubectl. The MaintenanceWindow controller writes it again each time the window opens or closes.
| Field | Type | Description |
|---|---|---|
conditions | []object | Conditions: 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. |
nextChange | string (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. |
open | boolean | Open is true while one of the windows is open. |
Columns of kubectl get maintenancewindows (the columns marked wide show only with -o wide):
| Column | Value |
|---|---|
NAME | .metadata.name |
OPEN | .status.open |
NEXT CHANGE | .status.nextChange |
ZONE | .spec.timeZone |
AGE | .metadata.creationTimestamp |
Conditions
Section titled “Conditions”| 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.
Example
Section titled “Example”apiVersion: metal.platform-kit.org/v1alpha1kind: MaintenanceWindowmetadata: name: compute-weekendspec: 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"$ kubectl get maintenancewindowsNAME OPEN NEXT CHANGE ZONE AGEcompute-weekend false 2d Europe/Berlin 5dStart one operation outside the windows
Section titled “Start one operation outside the windows”Use this procedure for an urgent change, for example a security correction.
-
Find the operation that waits. The column BLOCKED shows
OutsideMaintenanceWindow.Terminal window kubectl get hostoperations -n pk-metal -o wide -
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" -
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.