Skip to content

Day 2

Use maintenance windows

Make approved operations start only in agreed time slots. A window does not approve anything.

  • 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.
  1. Write a MaintenanceWindow.

    compute-weekend.yaml
    apiVersion: metal.platform-kit.org/v1alpha1
    kind: MaintenanceWindow
    metadata:
    name: compute-weekend
    spec:
    hostSelector:
    matchLabels:
    role: worker
    clusters: [prod]
    timeZone: Europe/Berlin
    weekly:
    - days: [Sat]
    start: "22:00"
    duration: 6h
    once:
    - start: "2026-12-03T18:00:00+01:00"
    end: "2026-12-03T23:00:00+01:00"
  2. Apply it.

    Terminal window
    kubectl apply -f compute-weekend.yaml
  3. Make sure that the operator can read it.

    Terminal window
    kubectl get maintenancewindows
    NAME OPEN NEXT CHANGE ZONE AGE
    compute-weekend false 2d Europe/Berlin 1m

For an urgent fix, annotate the operation. The value is your username and your reason.

Terminal window
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.

  • kubectl describe maintenancewindow compute-weekend shows Valid=True.
  • An approved operation outside the window shows OutsideMaintenanceWindow in the BLOCKED column.
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