Lab · reference
lab.yaml
lab/lab.yaml is the lab spec. It gives the cluster name, the versions, the size and the shape of the machines.
mise run lab:render writes all other files of the lab from it.
At a glance
Section titled “At a glance”- File
- lab/lab.yaml. Set
PK_LAB_SPECto use a different file. - Rendered into
.lab/generated/- Rendered by
- mise run lab:render, and mise run lab:up each time it runs.
- Default size
- One control plane and two workers.
- Limit
- 99 machines.
- Unknown keys
- An error. The renderer does not ignore a key that it does not know.
Fields
Section titled “Fields”| Field | Default in the file | Meaning |
|---|---|---|
cluster.name |
lab |
The name of the TalosCluster. |
cluster.talosVersion |
v1.14.6 |
The Talos release. PK_LAB_TALOS replaces it. |
cluster.kubernetesVersion |
v1.36.2 |
The Kubernetes release. |
cluster.vip |
10.77.0.10 |
The address of the Kubernetes API. It must be below .11. |
controlPlanes |
1 |
1, 3 or 5. The renderer refuses an even number. |
workers |
2 |
0 or more. |
controlPlane |
{ memoryMiB: 4096, cpus: 2 } |
The shape of each control plane. |
worker |
{ memoryMiB: 2048, cpus: 2 } |
The shape of each worker. |
nodes.<name> |
node-3: { personality: supermicro-x12 } |
Values for one machine: personality, memoryMiB, cpus. |
patches[].inline |
Time and DNS patches | Talos configuration documents. They go into the TalosCluster as they are. |
workload |
None | A second cluster for mise run lab:pivot: name, vip, controlPlanes, workers. |
The renderer ignores an entry below nodes for a machine that the size does not include.
The smallest memory for a machine is 1024 MiB.
What comes from the machine number
Section titled “What comes from the machine number”The machines have the names node-1, node-2, and so on. The control planes come first.
The renderer derives all identity values from the number n, so the files always agree.
| Value | Rule | node-1 |
|---|---|---|
| Address | 10.77.0.<10+n> |
10.77.0.11 |
| BMC | https://10.77.0.1:<8440+n> |
https://10.77.0.1:8441 |
| Serial number | PKLAB and n with four digits |
PKLAB0001 |
| Host name | The serial number in lower case | pklab0001 |
| Tap | pktap<n> |
pktap1 |
| BMC MAC address | 02:77:00:00:01:<n> in hexadecimal |
02:77:00:00:01:01 |
| NIC MAC address | 52:54:00:77:00:<0x10+n> |
52:54:00:77:00:11 |
| Disk serial number | pklab-disk-<n> |
pklab-disk-1 |
Rendered files
Section titled “Rendered files”File in .lab/generated/ |
Contents | Read by |
|---|---|---|
fleet.yaml |
The machines that the simulated BMCs serve | pk-metal sim |
manifests/10-machines.yaml |
The Secret with the BMC credentials and one Asset for each machine | The operator |
manifests/20-talos.yaml |
The TalosCluster and one TalosNode for each machine | The operator |
manifests/30-claims.yaml |
One HostClaim for each machine | The operator |
taps |
The tap names | lab/net.sh |
ledger.yaml |
BMC MAC address to BMC URL | The operator. See Ledger. |
lab.env |
Names and counts for lab/lab.sh |
The lab tasks |
workload/ |
The TalosCluster, TalosNodes and HostClaims of the second cluster | mise run lab:pivot |
Environment variables
Section titled “Environment variables”PK_LAB_NODES
Section titled “PK_LAB_NODES”The size of the lab as <control planes>cp+<workers>w, for example 3cp+2w.
- mise run lab:doctor, mise run lab:render and mise run lab:up read it. The other tasks use the size that the last mise run lab:up rendered.
- Use 1, 3 or 5 control planes. etcd needs a majority.
3cp+0wis a correct size. The control planes then also run workloads.- With three or more control planes, the VIP moves to a different control plane when its holder stops.
- You cannot change the size while the fleet runs.
To change the size of a lab that runs:
mise run lab:down && mise run lab:resetPK_LAB_NODES=3cp+2w mise run lab:upPK_LAB_WORKLOAD
Section titled “PK_LAB_WORKLOAD”The size of a second cluster, in the same form, for example 1cp+0w.
- Without a
workloadsection in the spec, the second cluster has the nameworkand the VIP10.77.0.9. - Its machines come after the machines of the first cluster. With
1cp+0wand1cp+0w,node-2is the second cluster. - The lab does not install the second cluster at mise run lab:up. mise run lab:pivot installs it.
- With a second cluster, the first cluster gets a registry mirror for
10.77.0.1:5000.
PK_LAB_TALOS
Section titled “PK_LAB_TALOS”A Talos release that replaces cluster.talosVersion, for example v1.14.5.
- The lab writes a copy of the spec to
.lab/spec.talos-<version>.yaml. The file in git does not change. - mise run lab:upgrade upgrades the cluster to the release in the spec.
- Set it again on each
lab:upof that lab. mise run lab:up records the release in.lab/talos-override. - A
lab:upwithout it stops while the cluster still asks for the recorded release. Thus it does not start an upgrade outside mise run lab:upgrade. - After mise run lab:upgrade, or after mise run lab:reset, the record is gone.
Other variables
Section titled “Other variables”| Variable | Default | Meaning |
|---|---|---|
PK_LAB_DIR |
<repo>/.lab |
The directory for the state of the lab. |
PK_LAB_SPEC |
<repo>/lab/lab.yaml |
The lab spec. |
PK_LAB_KIND_CONFIG |
<repo>/lab/kind.yaml |
The definition of the kind cluster. |
PK_LAB_MIN_FREE_GIB |
15 |
The free disk that the doctor asks for. |
PK_LAB_WAIT_TIMEOUT |
2400 |
Seconds for mise run lab:wait, mise run lab:scale, mise run lab:pivot and mise run lab:backup-restore. |
PK_LAB_RELEASE_TIMEOUT |
900 |
Seconds for mise run lab:release. |
PK_LAB_DAY2_TIMEOUT |
1200 |
Seconds for each reboot in mise run lab:day2. |
PK_LAB_ROLLOUT_TIMEOUT |
2400 |
Seconds for a rollout in mise run lab:day2 and mise run lab:upgrade. |
PK_LAB_BRIDGE |
pkbr0 |
The bridge name. Read by lab/net.sh. |
PK_LAB_ADDRESS |
10.77.0.1/24 |
The address of the workstation on the bridge. Read by lab/net.sh. |
PK_LAB_TAP_USER |
The user that starts the lab | The owner of the taps. Read by lab/net.sh. |
PK_METAL_QEMU |
Found on the PATH |
The QEMU binary. |
PK_METAL_OVMF_CODE, PK_METAL_OVMF_VARS |
Found in the system | The firmware pair for the machines. |
Change the Talos patches
Section titled “Change the Talos patches”The patches list goes into the TalosCluster. Use it for DNS, time and a proxy.
- Edit the
patcheslist inlab/lab.yaml. - Run mise run lab:up before you approve the installs.
See Behind a proxy for an example.