Skip to content

Controller · manager

MaintenanceWindow controller

A MaintenanceWindow says when approved work may start on the machines that it covers. The MaintenanceWindow controller only writes the status for people. The HostOperation controller computes the windows itself before an operation starts.

Reconciles
MaintenanceWindow (For). Controller name maintenancewindow.
Writes
status.open, status.nextChange and the condition Valid.
Talks to
Nothing outside the cluster.
Requeue
One second after the next opening or closing.
Source
window.go
Kind Relation Why a change starts a pass
MaintenanceWindow For You changed the window.
The MaintenanceWindow loop: parse the window, compute open and next change, update status, requeue at the next change.Read the window1StopgoneParse ittime zone, HH:MM, days, selector2Valid = FalseWindowInvalid, never openCompute open and next change3Update status if changed4next pass: 1 s after the next change
  1. Read the window.
  2. Check what the schema cannot check. The time zone exists. Each start is HH:MM and each day is known. Each weekly duration is from 1 minute to 168 hours. The selector parses.
  3. Lay out the weekly slots in the time zone of the window, day by day, and add the once spans. A slot keeps its local start time across a daylight-saving change. Spans that touch make one longer opening.
  4. Write open and nextChange, and requeue for the next change.

Before an operation writes its baseline, the executor asks the gate. An operation that started is never asked again, so a window that closes never stops a step.

  1. An operation with metal.platform-kit.org/ignore-window is exempt. A new install (reason Provisioning) is exempt, because it disturbs no running workload.
  2. A window covers a Host if its hostSelector matches the Host labels, or if clusters names the cluster of the node that the Host runs.
  3. If no window covers the Host, the operation starts.
  4. If one covering window is open, the operation starts.
  5. Otherwise the operation waits with OutsideMaintenanceWindow. It looks again when the next window opens, and at least each 5 minutes.
Object or field When Field manager
Window status open, nextChange, Valid When it changed manager (status update)
Operation Executed=Unknown, OutsideMaintenanceWindow Gate holds (executor) manager (status update)
Condition Status Reason
Valid True WindowValid
Valid False WindowInvalid
You see Cause Do this
Operation waits with OutsideMaintenanceWindow A covering window is closed. Wait, or annotate the operation: metal.platform-kit.org/ignore-window="<username>: <reason>".
Valid=False A typo in the time zone or the start time. Correct the window. Until then it holds the machines.
API groupResourcesVerbsScope
metal.platform-kit.orgmaintenancewindowsgetlistwatchcluster
metal.platform-kit.orgmaintenancewindows/statusupdatecluster