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
Propose
A controller writes a HostOperation with its own name in spec.proposedBy. The operation waits. Nothing changes on the machine.
pk-metal statusPropose. A controller writes a HostOperation with its own name in spec.proposedBy. The operation waits. Nothing changes on the machine.
pk-metal statusRead 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>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>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 | ClusterDisruptionRun. 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 topResult. 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>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
- A controller proposes a HostOperation. Its phase is
AwaitingApproval. - Find the operations that wait with pk-metal status or pk-metal top.
- 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.
- The HostOperation controller checks the gates before the start, in this sequence:
- an abort ends the operation;
- a TalosRollout must cover the operation, if it names one;
- only one operation runs on a Host at a time;
- a Host in maintenance mode holds the operation;
- a MaintenanceWindow holds it until a window opens;
- Self-protection and the Cluster guard hold power actions.
- The executor runs the actions one at a time. See Actions.
- The operation ends as
Succeeded,FailedorAborted.
Your commands
Section titled “Your commands”| 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 |
Who may do what
Section titled “Who may do what”- 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:adminsby default. Only an admin can give a claimspec.osor set its approval to Automatic. - Approval
- Write once. Nobody can change it after it is written.
Rollouts
Section titled “Rollouts”A TalosRollout has one approval for the full plan. The operations that it makes need no approval of their own. See Day-2 change.
Runbooks for this flow
Section titled “Runbooks for this flow”| Symptom | Runbook |
|---|---|
The operation is Failed |
Operation failed |
| The approval waits for more than a day | Alert PkMetalApprovalWaiting, see Observability |