Reference · pk-metal
Commands
pk-metal is the command line program of the operator. It has 25 commands.
Each command has one page with its flags, its steps and the objects that it reads and writes.
At a glance
Section titled “At a glance”- Program
pk-metal, one binary.- Form
pk-metal [--kubeconfig file] [--context name] <command> [flags] [arguments]- Help
pk-metal help <command>, orpk-metal <command> -h.- Cluster access
- The Global flags select the cluster, as for
kubectl. - Approval
- No command changes a machine by itself, with one exception: pk-metal boot. See Approval.
- Source
- cli.go
What the commands talk to
Section titled “What the commands talk to”Most commands write an object or an annotation in the management cluster. The operator then proposes a HostOperation, and a person approves it with pk-metal approve.
Commands by purpose
Section titled “Commands by purpose”A badge shows the effect of each command.
- changes machines
- The command can change a machine, or it can change what the operator does.
- changes no machine
- The command only reads, or it writes files on your workstation.
Inspect
Read the state of the machines, the BMCs and the clusters.
| Command | What it does | Effect |
|---|---|---|
| pk-metal status | Shows the machines, the BMCs, the claims, the operations and the clusters, with the reason for each block. | changes no machine |
| pk-metal top | Shows a live view of each machine, with keys to approve, hold and retry. | changes machines |
| pk-metal check | Tests that a BMC answers, and lists its virtual media slots and its systems. | changes no machine |
| pk-metal inventory | Reads the hardware inventory from a BMC and prints it as YAML. | changes no machine |
| pk-metal version | Prints the version of the pk-metal program. | changes no machine |
Approve and control
Decide what the operator does with its proposals.
| Command | What it does | Effect |
|---|---|---|
| pk-metal approve | Shows the plan of a proposed operation, asks, and approves it as your cluster user. | changes machines |
| pk-metal retry | Deletes a failed or aborted operation, so that the operator proposes the same plan again. | changes machines |
| pk-metal abort | Stops an operation before its next step. The operator then removes what the operation left on the machine. | changes machines |
| pk-metal hold | Stops the operator from new proposals for one claim. Nothing on the machine changes. | changes machines |
| pk-metal unhold | Removes a hold from a claim, so that the operator proposes operations for it again. | changes machines |
| pk-metal rollout | Lists the rollouts of a Talos cluster, shows a plan, and approves, pauses, resumes or aborts a rollout. | changes machines |
Day 1: first machines
Start the first machines of a site without the operator, then move the operator.
| Command | What it does | Effect |
|---|---|---|
| pk-metal render | Writes the Talos machine configs, the talosconfig and the kubeconfig from manifest files. It touches no machine. | changes no machine |
| pk-metal boot | Mounts a machine configuration ISO through a BMC and restarts the machine into it, without the operator. | changes machines |
| pk-metal bootstrap | Starts a new Talos cluster on machines that run Talos, and waits until each node is ready, without the operator. | changes machines |
| pk-metal relay | Runs on a host that can reach the BMCs and passes the boot media traffic to pk-metal boot. | changes no machine |
| pk-metal pivot | Moves the operator and its objects from this cluster to a different cluster. | changes machines |
Day 2: operation
Ask the operator for a change to a node or to a cluster that runs.
| Command | What it does | Effect |
|---|---|---|
| pk-metal reboot | Proposes a clean reboot of one Talos node - cordon, drain, reboot, wait, uncordon. | changes machines |
| pk-metal upgrade | Sets the Talos or Kubernetes version that a cluster asks for, and shows the rollout that the operator proposes. | changes machines |
| pk-metal scale | Shows which machines a cluster gets or gives back to reach a size. With --apply, it writes the claims. | changes machines |
| pk-metal reinstall | Asks the operator to wipe a node and install it again on the same machine. | changes machines |
| pk-metal replace | Moves a node to a different machine, for hardware that failed. The operator releases the old machine first. | changes machines |
| pk-metal wipe | Asks the operator to wipe a released machine that can still hold the install of a node. | changes machines |
| pk-metal backup | Takes an etcd snapshot now, lists the snapshots, downloads one, or decrypts one on your workstation. | changes machines |
| pk-metal restore | Finds what is wrong with the etcd of a cluster, proposes the operations that restore it, and uploads an approved snapshot. | changes machines |
Lab and simulation
Run simulated BMCs for tests and for the virtual lab.
| Command | What it does | Effect |
|---|---|---|
| pk-metal sim | Runs simulated BMCs for tests - one BMC, or a fleet with a virtual machine behind each BMC. | changes no machine |
Read the help
Section titled “Read the help”Each command prints its own help. The help of the program lists all commands.
pk-metal help approve
pk-metal approve: show what a proposed operation will do to a machine, then let it run; without a name, list the operations that wait for approval
usage: pk-metal approve [-n namespace] [--yes] [<operation> | <namespace>/<operation>]
...
flags:
-n string
namespace of the operation (default "pk-metal")
-yes
approve without asking (for scripts); the plan is still printed
A flag can have one dash or two dashes: -yes and --yes are the same flag.
Exit status
Section titled “Exit status”| Code | Meaning |
|---|---|
0 | Success. |
1 | Error; the message is on stderr, as "pk-metal: <message>". |
2 | Something is blocked or failed and needs a person. Only pk-metal status gives this code. |
A wrong flag or a wrong argument also gives code 1. The program then prints the usage line of the command.