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.
Synopsis
Section titled “Synopsis”pk-metal scale [-n namespace] --control-planes N --workers M [--apply] [--ack-etcd-risk reason] <cluster><cluster>- The name of the TalosCluster.
| Flag | Default | Description |
|---|---|---|
--ack-etcd-risk<string> | - | Reason to accept passing through an even number of control planes; stored on the claim as "<your username>: <reason>". |
--apply | false | Create and delete the claims of the plan. |
--control-planes<int>required | - | Control planes wanted. |
-n<string> | default | Namespace for the claims of new nodes. |
--workers<int>required | - | Workers wanted. |
This command also accepts the global flags --kubeconfig and --context.
What it does
Section titled “What it does”- The command reads the TalosNodes of the cluster, all claims and all Hosts.
- It counts the members: the TalosNodes that have a claim.
- It makes the plan and prints it.
- With
--apply, it makes the new claims first. Then it deletes the claims of the nodes that go. - The operator proposes one operation for each change. Approve each one with pk-metal approve.
To add nodes
Section titled “To add nodes”- 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.
To remove nodes
Section titled “To remove nodes”- 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.
Examples
Section titled “Examples”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 --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
Objects
Section titled “Objects”| 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. |
Exit status
Section titled “Exit status”Related
Section titled “Related”- Scale control planes
- Add a node and Remove a node
- Release a host describes what the operator does when a claim goes.
- pk-metal wipe makes a released machine free again when the operator could not reset it.
- pk-metal replace moves one node to a different machine.
- HostClaim controller