Skip to content

Workflow

Approval flow

Each change to a machine goes through the same gate. A controller proposes a HostOperation, a person approves it, and only then the executor runs it. Approval explains why.

Approval gate

1 / 7

A controller proposes a HostOperation. A person approves it through the admission policy. The executor checks the gates, then runs the actions on the machine.ControllerproposerHostOperation-YouapproverHostClaimno holdGates-Admission policywho may approveExecutorone action at a timeMachineno changeproposesapprovescheckedactionshold

Propose

A controller writes a HostOperation with its own name in spec.proposedBy. The operation waits. Nothing changes on the machine.

pk-metal status
  1. Propose. A controller writes a HostOperation with its own name in spec.proposedBy. The operation waits. Nothing changes on the machine.

    pk-metal status
  2. Read the plan. pk-metal approve prints each step in plain words. Read the plan before you answer. The question stops after five minutes.

    pk-metal approve -n pk-metal <operation>
  3. Admission. You approve as yourself. The admission policy refuses an approval by the operator, and an approval that someone changes later. Your site decides if you can approve your own proposal.

    spec.approval.approvedBy: <you>
  4. Gates. Before the start, the executor checks the queue, maintenance mode, the maintenance windows and the guards. A closed gate is a wait, not a failure.

    blockedOn: OperationQueued | OutsideMaintenanceWindow | ClusterDisruption
  5. Run. All gates are open. The executor records a baseline, then runs the actions one at a time. Each action checks first, then acts.

    pk-metal top
  6. Result. The operation is Succeeded, Failed or Aborted. The operator does not retry a failed operation. Use pk-metal retry after you fix the cause.

    pk-metal retry -n pk-metal <operation>
  7. Say no. To refuse a proposal, hold the claim or remove spec.os from it. If you delete a proposal, the operator proposes it again.

    pk-metal hold default/node-1
  1. A controller proposes a HostOperation. Its phase is AwaitingApproval.
  2. Find the operations that wait with pk-metal status or pk-metal top.
  3. Read the plan and approve it with pk-metal approve. You can approve your own proposal only if your site allows it. See Set up approval permissions.
  4. The HostOperation controller checks the gates before the start, in this sequence:
    1. an abort ends the operation;
    2. a TalosRollout must cover the operation, if it names one;
    3. only one operation runs on a Host at a time;
    4. a Host in maintenance mode holds the operation;
    5. a MaintenanceWindow holds it until a window opens;
    6. Self-protection and the Cluster guard hold power actions.
  5. The executor runs the actions one at a time. See Actions.
  6. The operation ends as Succeeded, Failed or Aborted.
You want to Command Effect
See what waits pk-metal status Lists operations in AwaitingApproval
Approve pk-metal approve Writes spec.approval.approvedBy with your name
Stop new proposals for a claim pk-metal hold Sets metal.platform-kit.org/hold on the claim
Allow proposals again pk-metal unhold Removes the hold
Stop an approved operation pk-metal abort Stops before the next action and undoes media, boot override and cordon
Try a failed operation again pk-metal retry Deletes it, the operator proposes it again
Proposer
The name in spec.proposedBy. The admission policy makes sure that it is the user who writes the object.
Approver
A user with the ClusterRole pk-metal-approver. The approver must not be the proposer.
Admin
A member of the admin group, pk-metal:admins by default. Only an admin can give a claim spec.os or set its approval to Automatic.
Approval
Write once. Nobody can change it after it is written.

A TalosRollout has one approval for the full plan. The operations that it makes need no approval of their own. See Day-2 change.

Symptom Runbook
The operation is Failed Operation failed
The approval waits for more than a day Alert PkMetalApprovalWaiting, see Observability