Skip to content

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.

Program
pk-metal, one binary.
Form
pk-metal [--kubeconfig file] [--context name] <command> [flags] [arguments]
Help
pk-metal help <command>, or pk-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
pk-metal talks to the Kubernetes API for most commands. The operator then acts on the BMC. A small set of commands talks to a BMC or to the Talos API directly.management clustermachinespk-metalyour workstationKubernetes APIobjects of pk-metalOperatorcontrollersTalos APInodesBMCRedfishstatus, approve, scale ...watchRedfishbootstrap, restorecheck, inventory, boot
Most commands write an object or an annotation through the Kubernetes API. The operator does the work on the machine.

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.

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.

CommandWhat it doesEffect
pk-metal statusShows the machines, the BMCs, the claims, the operations and the clusters, with the reason for each block.changes no machine
pk-metal topShows a live view of each machine, with keys to approve, hold and retry.changes machines
pk-metal checkTests that a BMC answers, and lists its virtual media slots and its systems.changes no machine
pk-metal inventoryReads the hardware inventory from a BMC and prints it as YAML.changes no machine
pk-metal versionPrints the version of the pk-metal program.changes no machine

Approve and control

Decide what the operator does with its proposals.

CommandWhat it doesEffect
pk-metal approveShows the plan of a proposed operation, asks, and approves it as your cluster user.changes machines
pk-metal retryDeletes a failed or aborted operation, so that the operator proposes the same plan again.changes machines
pk-metal abortStops an operation before its next step. The operator then removes what the operation left on the machine.changes machines
pk-metal holdStops the operator from new proposals for one claim. Nothing on the machine changes.changes machines
pk-metal unholdRemoves a hold from a claim, so that the operator proposes operations for it again.changes machines
pk-metal rolloutLists 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.

CommandWhat it doesEffect
pk-metal renderWrites the Talos machine configs, the talosconfig and the kubeconfig from manifest files. It touches no machine.changes no machine
pk-metal bootMounts a machine configuration ISO through a BMC and restarts the machine into it, without the operator.changes machines
pk-metal bootstrapStarts a new Talos cluster on machines that run Talos, and waits until each node is ready, without the operator.changes machines
pk-metal relayRuns on a host that can reach the BMCs and passes the boot media traffic to pk-metal boot.changes no machine
pk-metal pivotMoves 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.

CommandWhat it doesEffect
pk-metal rebootProposes a clean reboot of one Talos node - cordon, drain, reboot, wait, uncordon.changes machines
pk-metal upgradeSets the Talos or Kubernetes version that a cluster asks for, and shows the rollout that the operator proposes.changes machines
pk-metal scaleShows which machines a cluster gets or gives back to reach a size. With --apply, it writes the claims.changes machines
pk-metal reinstallAsks the operator to wipe a node and install it again on the same machine.changes machines
pk-metal replaceMoves a node to a different machine, for hardware that failed. The operator releases the old machine first.changes machines
pk-metal wipeAsks the operator to wipe a released machine that can still hold the install of a node.changes machines
pk-metal backupTakes an etcd snapshot now, lists the snapshots, downloads one, or decrypts one on your workstation.changes machines
pk-metal restoreFinds 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.

CommandWhat it doesEffect
pk-metal simRuns simulated BMCs for tests - one BMC, or a fleet with a virtual machine behind each BMC.changes no machine

Each command prints its own help. The help of the program lists all commands.

help
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.

CodeMeaning
0Success.
1Error; the message is on stderr, as "pk-metal: <message>".
2Something 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.