Install Talos on a node
Boot a running NixOS node into the Talos installer with kexec, check it in maintenance mode, and check its volumes after the install.
Use this runbook to boot a NixOS node into the Talos Linux installer without a USB drive or a site visit. kexec loads the Image Factory kernel for the cluster's schematic from the running system. Talos then waits in maintenance mode, with the disk untouched, until the clusters/<site>/talos/ root applies its machine config and installs it. Rebuild a cluster on Talos says when to run it for each node. To install a folly node with Secure Boot, use Provision a node instead.
warning
This procedure changes live state by hand. It is an exception to the GitOps rule because the node runs no Talos API until it boots the installer.
Before you start#
- You need SSH access to the node as
jawn, withsudo, andtalosctlon your machine. - You need a path to the node's port 50000 that does not depend on the node's own cluster.
- On folly, you need
kubectlaccess, as Get cluster admin access describes, andopenssl. - Get the schematic ID from
tofu -chdir=clusters/<site>/talos output -raw schematic_id, and the version fromtalos_versioninclusters/<site>/talos/talos.tf.
<node> is the host name, and <addr> is its address: on folly its address in clusters/folly/inventory/nodes.yaml, the nodes file, and on offsite its entry in NODE_ADDRESSES in clusters/offsite/config/cluster-topology.json.
Load the installer#
Sign in to the node.
ssh <node>.lolwtf.caDownload the kernel, the initramfs and the kernel command line for the schematic.
S=<schematic> V=<version> sudo mkdir -p /var/tmp/talos && cd /var/tmp/talos sudo curl -fsSLo kernel-amd64 "https://factory.talos.dev/image/$S/$V/kernel-amd64" sudo curl -fsSLo initramfs-amd64.xz "https://factory.talos.dev/image/$S/$V/initramfs-amd64.xz" sudo curl -fsSLo cmdline "https://factory.talos.dev/image/$S/$V/cmdline-metal-amd64"Make sure that the command line names the platform.
grep -o 'talos.platform=metal' cmdlineResult:
talos.platform=metal.Load the installer, and make sure that the kernel holds it.
sudo kexec -l kernel-amd64 --initrd=initramfs-amd64.xz --command-line="$(cat cmdline)" cat /sys/kernel/kexec_loadedResult:
1.
caution
The next step stops every pod on the node. Maintenance mode cannot reboot. Only a machine config or a power cycle takes the node out of it.
Boot the installer.
sudo systemctl kexec
Check maintenance mode#
From your machine, make sure that Talos answers.
talosctl version --insecure --nodes <addr>Result: A
Serverblock with the Talos version.Make sure that the schematic's extensions loaded.
talosctl get extensions --insecure --nodes <addr>Result:
gvisor,i915,intel-ucode,kata-containers,realtek-firmware, and a row named for the schematic ID.Read the disks and the links.
talosctl get disks --insecure --nodes <addr> talosctl get links --insecure --nodes <addr>Result: The install disk named by
installfor the node intalos.tf, and anenoorenplink up. Cilium'sdevicesmatches those names.Read the GPU's kernel log.
talosctl dmesg --insecure --nodes <addr> | grep -iE 'i915|wedged|GuC'Result: i915 lines with no
wedged.
note
A GPU that was never reset can wedge after kexec. Whether Talos boots cleanly with module_blacklist=i915 on the command line is not known.
Check the volumes after the install#
The clusters/<site>/talos/ apply installs Talos and reboots the node. Then do these checks before a pod lands on the node. A pod that lands first writes to EPHEMERAL, and the error is silent.
Read the volumes.
talosctl --context <site> -n <addr> get volumestatusResult:
EPHEMERAL,u-dataand, on the control plane,ETCD, each in the phaseready.Make sure that the
datavolume is mounted.talosctl --context <site> -n <addr> get mountstatusResult:
/var/mnt/datawith the filesystemxfs.Make sure that the node runs the root's installer.
talosctl --context <site> -n <addr> version --shortResult: The
talos_versionof the root.If the node is riptide, power-cycle it once before you use the GPU.
talosctl --context <site> -n <addr> reboot --mode powercycle
Approve the node's first certificate#
On folly, the controller manager approves no kubelet certificate that a bootstrap token asks for: an admission policy in clusters/folly/tinkerbell-access/node-client-approval.yaml refuses it the approval. fleetd approves only a worker that it installs. A node that joins with the cluster's token, such as shale or a control plane, waits for you. A cluster that Talos bootstrapped approves its first nodes itself until Flux applies that file. KubeletCSRPending fires when a request waits an hour. offsite approves its nodes itself.
Find the node's request.
kubectl --context folly get csr --field-selector spec.signerName=kubernetes.io/kube-apiserver-client-kubeletResult: A
Pendingrequest whose requestor issystem:bootstrap:<id>, the ID of the cluster's token. fleetd also journals it on the node's NetBox device.Make sure that the request names the node you install, and nothing more.
kubectl --context folly get csr <csr> -o jsonpath='{.spec.request}' | base64 -d | openssl req -noout -subject -text | grep -E 'subject=|Alternative'Result:
subject=O=system:nodes, CN=system:node:<node>, and noAlternativeline.
warning
A certificate for a node's name gets the service-account tokens of the pods on that node. Approve only a request for a join that you started.
Approve the request.
kubectl --context folly certificate approve <csr>Result: The node registers within a minute. The kubelet waits an hour for an approval, then asks again with a new request.
If something goes wrong#
| Symptom | Cause | Action |
|---|---|---|
| The node is back on NixOS about 25 seconds after the kexec. | The command line lacks talos.platform=metal. | Do the procedure again with the factory's cmdline-metal-amd64. |
systemctl kexec reboots into NixOS. | Nothing was loaded, so NixOS loaded itself. | Do step 4 again, and check kexec_loaded. |
Talos does not answer on <addr>. | The node hangs, or DHCP gave another address. | Find the node's lease by MAC, as Inspect the UniFi network describes. If the node hangs, power-cycle it. The disk is untouched. |
A volume is missing or not ready. | The disk layout did not provision. | Boot the node from https://factory.talos.dev/image/<schematic>/<version>/metal-amd64.iso on a USB drive, then apply the root again. |
A folly node stays NotReady or does not register, and its kubelet's request is Pending. | The request waits for the owner's approval. | Do Approve the node's first certificate. |
Related#
Linked from 10
- Operate fleetdAccess, alerts and recovery limits for fleetd.
- KubernetesThe folly and offsite Kubernetes clusters, how Flux applies clusters/ from git, and the sandbox runtimes and storage the clusters offer.
- Talos LinuxHow the Talos roots install and configure each Kubernetes node, which nodes boot a signed image, and which nodes seal their disks to the TPM.
- Build the signed Talos imagesRun the Talos image pipeline for folly, and check the signed installer, ISO, iPXE and HookOS that it publishes.
- Deploy a NixOS hostDeploy the NixOS configuration of a host from your machine or from GitHub Actions, or restore the previous generation.
- RunbooksStep-by-step procedures for the hosts, clusters, network, secrets and apps, grouped by area.
- Manage SOPS secretsRestore the operator age key, edit or add a SOPS file of encrypted secrets, give a NixOS host its own SOPS file, add a harmonia cache key, and rotate the operator key.
- Rebuild a cluster on TalosReplace a cluster's NixOS nodes with Talos Linux, bootstrap a fresh etcd, install Cilium and Flux, and restore the data that has a backup.
- Rotate the cluster bootstrap tokenReplace folly's cluster-wide Kubernetes bootstrap token in the Talos secrets bundle, apply it to the nodes that carry it, and delete the old token.
- Verify a Talos clusterCheck a cluster that runs Talos after a rebuild or an upgrade, from the nodes and Cilium to federation, backups, OpenBao, the sandbox runtimes, the GPU and Falco.