Skip to content

Command · pk-metal

pk-metal scale

changes machinesneeds the cluster

pk-metal scale prints the plan that takes a Talos cluster to the size that you give: so many control planes and so many workers. Nothing changes without --apply. With --apply, the command makes and deletes HostClaims, and the operator proposes the operations.

pk-metal scale [-n namespace] --control-planes N --workers M [--apply] [--ack-etcd-risk reason] <cluster>
<cluster>
The name of the TalosCluster.
FlagDefaultDescription
--ack-etcd-risk<string>-Reason to accept passing through an even number of control planes; stored on the claim as "<your username>: <reason>".
--applyfalseCreate and delete the claims of the plan.
--control-planes<int>required-Control planes wanted.
-n<string>defaultNamespace for the claims of new nodes.
--workers<int>required-Workers wanted.

This command also accepts the global flags --kubeconfig and --context.

  1. The command reads the TalosNodes of the cluster, all claims and all Hosts.
  2. It counts the members: the TalosNodes that have a claim.
  3. It makes the plan and prints it.
  4. With --apply, it makes the new claims first. Then it deletes the claims of the nodes that go.
  5. The operator proposes one operation for each change. Approve each one with pk-metal approve.
  • Write the TalosNode of each new node before you scale. The network, the disk and the role are your decision.
  • Each new node needs a free Host: Available, not claimed and wiped.
  • The command prefers the Host whose asset has the name of the node.
  • Each new node gets a HostClaim with the name of the node, in the namespace of -n.
  • Control planes join one at a time.
  • The command deletes the claims of the nodes with the highest names.
  • The operator drains each node and removes it from the cluster. Then it resets the machine, and the Host is free again.
  • The TalosNodes stay, without a machine, for the next time that you add nodes.
  • Control planes go one at a time. The etcd leader goes last.

The command refuses zero control planes.

pk-metal scale
pk-metal scale --control-planes 3 --workers 4 lab
cluster lab: 3 control plane(s) and 2 worker(s) now, 3 and 4 wanted
 1. add worker w-3 on host simhw2288v5000402: claim default/w-3; installed
 2. add worker w-4 on host simhw2288v5000403: claim default/w-4; installed
check: each added TalosNode's install disk and network links must fit the host it is paired with

Nothing changed. To do it: add --apply
pk-metal scale --control-planes 3 --workers 4 --apply lab
...
created claim default/w-3
created claim default/w-4
The operator proposes the operations; approve each with: pk-metal approve

A plan that the command cannot do shows the cause. --apply then changes nothing.

pk-metal scale
pk-metal scale --control-planes 3 --workers 6 lab
cluster lab: 3 control plane(s) and 4 worker(s) now, 3 and 6 wanted
cannot: 2 more worker TalosNode(s) of cluster lab are needed: write them (address, disk, links) first
Object Access Purpose
TalosCluster get Makes sure that the cluster exists.
TalosNode, Host list Finds the members, the spare nodes and the free machines.
HostClaim list, create, delete The plan. Only with --apply.
HostClaim patch Sets metal.platform-kit.org/ack-etcd-risk to <your username>: <reason> before it deletes a claim, with --ack-etcd-risk.
CodeMeaning
0Success.
1Error; the message is on stderr, as "pk-metal: <message>".