Lab · reference
Virtual lab
The virtual lab runs the operator and a small rack of machines on one workstation. The machines are real UEFI machines in QEMU, and the install is a real Talos install. Only the hardware is simulated.
At a glance
Section titled “At a glance”- Start
- mise run lab:up
- Default size
- One control plane and two workers. Change it with
PK_LAB_NODES. - Management cluster
- A kind cluster with the name
pk-metal. It runs the operator. - Machines
node-1,node-2, and so on. Each one is a QEMU virtual machine with a simulated BMC.- Network
- The bridge
pkbr0with10.77.0.0/24. See Lab network. - State
- The directory
.lab/. Git ignores it. The lab does not read or write~/.kube/config. - Root
- Only
lab/net.shusessudo. See What runs as root. - Source
- lab/lab.sh
What runs where
Section titled “What runs where”- Kind cluster
pk-metal - The management cluster. It has one node, a container on the workstation. lab/kind.yaml defines it.
- Operator pod
- The Deployment
pk-metal-managerin the namespacepk-metal. The lab builds its image from the working tree. See Manager. - Media store
- The operator serves boot media on port 8443. The NodePort 30443 publishes it at
https://10.77.0.1:30443, on the bridge address only. - Simulated fleet
- One
pk-metal sim fleetprocess on the workstation. It serves one BMC for each machine, at10.77.0.1:8441and up. See pk-metal sim. - QEMU virtual machines
- One for each BMC. A BMC starts and stops its virtual machine and gives it the virtual media. Machine
nhas the address10.77.0.<10+n>. - Cluster VIP
10.77.0.10. The control planes share this address for the Kubernetes API.- Bridge
pkbr0 - The workstation has the address
10.77.0.1on it. Each machine connects through one tap. The machines go to the outside through NAT.
What is real and what is simulated
Section titled “What is real and what is simulated”| Part | In the lab | At a real site |
|---|---|---|
| Operator image and manifests | The same | The same |
| Approval step | The same: pk-metal approve | The same |
| Talos install and cluster | The same | The same |
| Machine | QEMU virtual machine with OVMF | Server |
| BMC | Simulated Redfish service | BMC of the server |
| Management cluster | kind | A small cluster, then the cluster after a pivot |
How the lab starts
Section titled “How the lab starts”mise run lab:up runs seven parts in order. You can run it again. It continues where it stopped.
The parts of lab:up
1 / 7
Check the workstation
The doctor checks the tools, KVM, Docker, memory and disk. Each check that fails prints its fix. The doctor changes nothing.
lab/lab.sh doctorCheck the workstation. The doctor checks the tools, KVM, Docker, memory and disk. Each check that fails prints its fix. The doctor changes nothing.
lab/lab.sh doctorRender the spec. The renderer reads lab/lab.yaml and writes the fleet file, the manifests, the tap list and the ledger into .lab/generated.
lab/lab.sh renderMake the network. lab/net.sh makes the bridge pkbr0, one tap for each machine and the firewall rules. This is the only part that uses sudo.
lab/lab.sh networkStart the management cluster. kind starts one node. The media port 30443 is published on the bridge address only.
lab/lab.sh clusterDeploy the operator. The script builds the operator image from the working tree and loads it into kind. Then it applies the CRDs and the manager Deployment.
lab/lab.sh deployStart the simulated fleet. One pk-metal process serves a BMC for each machine. The script waits until each BMC answers.
lab/lab.sh fleetApply the manifests. The script applies the Assets, the TalosCluster, the TalosNodes and the HostClaims. The operator proposes one install for each machine. The installs wait for you.
lab/lab.sh manifests
$ mise run lab:up ok go ok kind ok kubectl ok talosctl ok yq ok jq ok curl ok docker daemon answers ok docker is Docker Engine on this host (not podman, not Docker Desktop) ok docker runs as root (rootless Docker is not supported) ok /dev/kvm is usable by alice ok QEMU (qemu-system-x86_64, /usr/libexec/qemu-kvm or $PK_METAL_QEMU) ok OVMF (UEFI firmware for the machines) ok https://factory.talos.dev answers (installer images) ok the lab spec renders ok 11264 MiB of available memory for 3 machines ok 15 GiB free under /home/alice/platform-kit/.lab the workstation has what the lab needs == render /home/alice/platform-kit/lab/lab.yaml into /home/alice/platform-kit/.lab/generated == lab network bridge pkbr0 tap pktap1 (owner alice) tap pktap2 (owner alice) tap pktap3 (owner alice) enable IPv4 forwarding firewall rules (forwarding in DOCKER-USER) == kind cluster pk-metal Creating cluster "pk-metal" ... == operator image == operator deployment (pk-metal:4f2a9c1) deployment "pk-metal-manager" successfully rolled out == simulated fleet started (pid 48213, log /home/alice/platform-kit/.lab/fleet.log) BMC https://10.77.0.1:8441 answers BMC https://10.77.0.1:8442 answers BMC https://10.77.0.1:8443 answers == lab manifests asset.metal.platform-kit.org/node-1 serverside-applied ... hostclaim.metal.platform-kit.org/node-3 serverside-applied The lab is up. The operator now enrolls the machines and proposes to boot them. watch it: mise run lab:status let it happen: mise run lab:approve (the one human step) afterwards: mise run lab:kubeconfig
After the last part, the operator enrolls the machines and proposes one install for each machine. No machine changes before you approve. See Approval.
Files that the lab writes
Section titled “Files that the lab writes”All files are below .lab/. Set PK_LAB_DIR to move the directory.
| Path | Contents |
|---|---|
generated/ |
The files that mise run lab:render writes from lab/lab.yaml. Do not edit them. |
kubeconfig |
The kubeconfig of the management cluster. |
workload.kubeconfig, talosconfig |
The access files of the Talos cluster. mise run lab:kubeconfig writes them. |
deploy/ |
The generated deployment of the operator and the Talos secrets bundle. |
state/<machine>/ |
The disk, the firmware variables and console.log of each machine. |
cache/ |
Installer images. The fleet downloads each image one time. |
fleet.log, fleet.pid |
The log and the process ID of the simulated fleet. |
diagnostics/ |
The output of mise run lab:collect. |
Pages in this section
Section titled “Pages in this section”- Lab prerequisites
- lab.yaml
- Lab tasks
- Simulated BMC
- Lab network
- What runs as root
- lab-e2e workflow
- Lab troubleshooting