Day 2
Use maintenance windows
Make approved operations start only in agreed time slots. A window does not approve anything.
Before you start
Section titled “Before you start”- You know which machines the window covers: a Host label, a cluster, or both.
- You know the time zone of the plan, as an IANA name, for example
Europe/Berlin.
- An approved operation on a covered machine waits until a window that covers it is open.
- A step that runs is never stopped when the window closes. Make windows long enough.
- A machine that no window covers is not held.
- New installs (reason
Provisioning) are not held. - A window that the operator cannot read is never open. It holds work back.
-
Write a MaintenanceWindow.
compute-weekend.yaml apiVersion: metal.platform-kit.org/v1alpha1kind: MaintenanceWindowmetadata:name: compute-weekendspec:hostSelector:matchLabels:role: workerclusters: [prod]timeZone: Europe/Berlinweekly:- days: [Sat]start: "22:00"duration: 6honce:- start: "2026-12-03T18:00:00+01:00"end: "2026-12-03T23:00:00+01:00" -
Apply it.
Terminal window kubectl apply -f compute-weekend.yaml -
Make sure that the operator can read it.
Terminal window kubectl get maintenancewindowsNAME OPEN NEXT CHANGE ZONE AGEcompute-weekend false 2d Europe/Berlin 1m
Start one operation now
Section titled “Start one operation now”For an urgent fix, annotate the operation. The value is your username and your reason.
me=$(kubectl auth whoami -o jsonpath='{.status.userInfo.username}')kubectl -n pk-metal annotate hostoperation simhw2288v5000398-bios-4b5c6d7e \ metal.platform-kit.org/ignore-window="$me: CVE fix, agreed with on-call"The operation still needs its approval.
Verify
Section titled “Verify”kubectl describe maintenancewindow compute-weekendshowsValid=True.- An approved operation outside the window shows
OutsideMaintenanceWindowin theBLOCKEDcolumn.
If it fails
Section titled “If it fails”| What you see | Go to |
|---|---|
Valid=False |
The message names the bad time zone or selector. |
| Work does not start when the window opens | Operation held |
Related
Section titled “Related”- MaintenanceWindow
- mise run lab:observe shows a window that holds an operation in the lab.