Tutorial
Scaling in the lab
In this tutorial, you change the size of a cluster that runs. You tell the operator the size that you want. The operator proposes one operation for each machine.
What you make
Section titled “What you make”- A cluster that lost two control planes and got them back, one at a time.
- A worker that left the cluster. Its machine is Available again, with a wiped disk.
- A control plane that moved to a different machine.
Time and prerequisites
Section titled “Time and prerequisites”- Time
- About 90 minutes.
- Before
- Your first cluster in the lab
- Memory
- About 19 GiB free, for five machines. See memory. For less memory, see On a workstation with 16 GB.
- Lab
- Down. Step 1 starts a lab with five machines.
The unattended task mise run lab:scale does all steps without your hands, and it examines etcd on each turn.
$ mise run lab:scale == scale lab to 1 control plane cluster lab: 3 control plane(s) and 2 worker(s) now, 1 and 2 wanted == scale to 1 control plane: waiting up to 2400s for 1 etcd voter(s) and 3 Ready node(s) [2026-01-15 10:31:15 UTC] etcd: 3 voter(s), 0 learner(s); nodes: 5 of 5 Ready; ... [2026-01-15 10:35:40 UTC] etcd: 2 voter(s), 0 learner(s); nodes: 4 of 4 Ready; ... done after 562s: 1 etcd voter(s), 3 Ready node(s) == scale lab to 3 control planes [2026-01-15 10:44:02 UTC] etcd: 1 voter(s), 1 learner(s); nodes: 3 of 4 Ready; ... done after 733s: 3 etcd voter(s), 5 Ready node(s) == remove worker node-5 done after 148s: 3 etcd voter(s), 4 Ready node(s) == replace control plane node-2 onto Host pklab0005 == replace a control plane: releasing Host pklab0002 done after 604s: 3 etcd voter(s), 4 Ready node(s) == scale lab back to 1 control plane done after 498s: 1 etcd voter(s), 2 Ready node(s) the scale round finished: lab has 1 control plane and 1 worker
1. Start a lab with five machines
Section titled “1. Start a lab with five machines”-
If a lab runs, stop it and delete the disks.
Terminal window mise run lab:down && mise run lab:reset -
Start the lab with three control planes and two workers. See
PK_LAB_NODES.Terminal window PK_LAB_NODES=3cp+2w mise run lab:upmise run lab:wait -
Set the kubeconfig and the talosconfig for this terminal.
Terminal window export KUBECONFIG=$PWD/.lab/kubeconfigexport TALOSCONFIG=$PWD/.lab/talosconfig -
Write a kubeconfig for a member of the admin group. The admin of kind is not a member.
Terminal window yq '.users[].user.as = "lab-admin"| .users[].user."as-groups" = ["system:masters", "pk-metal:admins", "system:authenticated"]' \.lab/kubeconfig > .lab/admin.kubeconfigOnly a member of the admin group can make a claim that installs a node. The same is true when a claim moves to a different machine. See Admission policies. The file uses impersonation, which is a shortcut of the lab. On a real site, your login gives you the group.
2. Remove two control planes
Section titled “2. Remove two control planes”-
Show the plan. Without
--apply, the command changes nothing.Terminal window metal/bin/pk-metal scale lab --control-planes 1 --workers 2Terminal window cluster lab: 3 control plane(s) and 2 worker(s) now, 1 and 2 wantedThe plan lists the claims that it deletes, and it tells you about the etcd risk.
-
Apply the plan. On the way, etcd has two members. Give a reason to accept this risk.
Terminal window metal/bin/pk-metal --kubeconfig .lab/admin.kubeconfig scale lab \--control-planes 1 --workers 2 --apply --ack-etcd-risk "lab tutorial" -
Approve the operations that the operator proposes.
Terminal window mise run lab:approve -
Do step 3 again until
mise run lab:statusshows no operation that waits. The control planes leave one at a time.
The operations use EtcdLeave, Drain and TalosReset. See pk-metal scale.
3. Add two control planes
Section titled “3. Add two control planes”-
Apply the larger size as the admin. The command makes claims that install a node.
Terminal window metal/bin/pk-metal --kubeconfig .lab/admin.kubeconfig scale lab \--control-planes 3 --workers 2 --applyTerminal window created claim default/node-2created claim default/node-3The operator proposes the operations; approve each with: pk-metal approve -
Approve the installs as they come. The operator adds one control plane at a time.
Terminal window mise run lab:approve -
Watch etcd. A new member is a learner first. Then it becomes a voter.
Terminal window talosctl --nodes 10.77.0.11 etcd members
4. Remove a worker
Section titled “4. Remove a worker”-
Apply the size with one worker. The operator removes
node-5.Terminal window metal/bin/pk-metal --kubeconfig .lab/admin.kubeconfig scale lab \--control-planes 3 --workers 1 --apply -
Approve the operation.
Terminal window mise run lab:approve -
Wait until the Host of
node-5isAvailable.Terminal window kubectl get host pklab0005
See Release a host and Release and reuse.
5. Replace the machine of a control plane
Section titled “5. Replace the machine of a control plane”You move node-2 from the Host pklab0002 to the free Host pklab0005, as you do when hardware fails.
-
Tell the claim to use the new Host, as the admin.
Terminal window metal/bin/pk-metal --kubeconfig .lab/admin.kubeconfig replace node-2 \--host pklab0005 --ack-etcd-risk "lab tutorial"Terminal window claim default/node-2 now selects host pklab0005 (asset node-5); it ran on host pklab0002. -
Approve the release of the old machine. Wait until
pklab0002isAvailable.Terminal window mise run lab:approvekubectl get host pklab0002 -
Change the disk and the network link of the TalosNode to the values of the new machine.
Terminal window kubectl patch talosnode node-2 --type json --patch '[{"op": "replace", "path": "/spec/installDiskSelector/serial", "value": "pklab-disk-5"},{"op": "replace", "path": "/spec/network/links/0/hardwareAddr", "value": "52:54:00:77:00:15"}]' -
Approve the install on the new machine.
Terminal window mise run lab:approve
The values come from the machine number. See lab.yaml. For a real site, see Replace a node and pk-metal replace.
If a step does not give its checkpoint, see Lab troubleshooting.
6. Stop the lab
Section titled “6. Stop the lab”-
Stop the lab and delete the disks.
Terminal window mise run lab:down && mise run lab:reset
On a workstation with 16 GB
Section titled “On a workstation with 16 GB”The default shape of five machines needs about 19 GiB. You can give each machine less memory.
-
Copy
lab/lab.yamltolab-small.yaml. -
In the copy, set
controlPlane.memoryMiBto2048andworker.memoryMiBto1024. -
In step 1, start the lab with the copy.
Terminal window PK_LAB_SPEC=$PWD/lab-small.yaml PK_LAB_NODES=3cp+2w mise run lab:up -
Keep
PK_LAB_SPECset in the terminal for allmise run lab:*commands of this tutorial.
The doctor then asks for 11264 MiB. The doctor names these values as the smallest for Talos. The installs and the etcd changes are slower. The end-to-end test does not run this shape.
What you learned
Section titled “What you learned”- You give the size. The operator finds the machines and the order: pk-metal scale.
- Control planes join and leave one at a time, so that etcd keeps a majority.
- A removed machine comes back to the pool with a wiped disk: Release and reuse.
- A replace releases the old machine first. Then it installs the node on the new machine.