I run Kubernetes at home on Talos. This post is how I install it, start to finish.
First, why Talos? I didn’t want a normal Linux box that happened to run Kubernetes. With a regular install, you SSH in and fix things by hand, and over time the nodes drift away from each other. Talos doesn’t have that problem because it doesn’t give you the option. There’s no SSH. There’s no package manager. The OS is immutable, you manage it through an API with talosctl, and a node’s configuration is a YAML file.
If a node breaks, you don’t sit there repairing it by hand. You reapply the config, or you rebuild the node.
When something’s wrong, your first instinct is to log in and look around. You can’t. You work through the API and the config instead.
Installing it
You boot a machine off an image, it comes up in maintenance mode, and you push a config to it. Before any of that, sort out the image.
Get the image right first
Don’t just grab the stock ISO.
Extensions — extra pieces the OS needs — get baked into the image using a schematic from Talos Image Factory. My storage runs on Longhorn, and Longhorn needs iSCSI, so my schematic has iscsi-tools in it. The one I run now has util-linux-tools too.
Yours will depend on what you’re running. Build the schematic with what you need in it, and use the image it gives you, both for the install and in the config itself. Storage worked until a node rebooted. Then it didn’t. That gets its own post.
Boot it and check the disk
Boot the machine off the ISO. It comes up unconfigured, waiting for a config.
Before applying anything, check the disks:
talosctl get disks --insecure --nodes <machine-ip>
Make sure the disk name and size match the machine you think you’re talking to. Early on, the nodes all look alike.
Apply the config
Generate the cluster config once, then adjust it per node — control plane or worker, hostname, install disk, and the install image.
The install image needs to be your schematic image:
machine:
install:
image: factory.talos.dev/installer/<your-schematic-id>:<talos-version>
If that points at the stock image instead, a reinstall can bring the node back without your extensions on it, even if you booted the right ISO the first time. Upgrades are the same: the image you pass to talosctl upgrade is what the node ends up running, so pass the schematic image there too.
Apply it:
talosctl apply-config --insecure --nodes <machine-ip> --file <node-config.yaml>
The node installs to disk and reboots.
Bootstrap — once
When the first control-plane node is up, point talosctl at it. Set the endpoint in your talosconfig, or pass --endpoints <first-control-plane-ip>. Then:
talosctl bootstrap --nodes <first-control-plane-ip>
Run it once, for the whole cluster — not once per control-plane node. Bootstrap is what creates the etcd cluster. Running it again on another node causes problems; it doesn’t help that node join the first cluster.
Then get your kubeconfig, which merges into ~/.kube/config by default:
talosctl kubeconfig --nodes <control-plane-ip>
Apply the rest of the node configs the same way, and the nodes join on their own.
Upgrades
Upgrades use the same schematic image, with --preserve:
talosctl upgrade --nodes <node-ip> --preserve --image factory.talos.dev/installer/<your-schematic-id>:<new-version>
--preserve keeps the data on the node’s ephemeral partition instead of wiping it during the upgrade. I use it on every upgrade.
Checking it worked
- Run
kubectl get nodesand confirm every node is Ready - Confirm every node is on the Talos version and schematic you meant to use
- Confirm the schematic image is in each machine config, not just the ISO you booted from
The install gave me no trouble. The hardware did — I started this cluster on three laptops — and so did the Longhorn reboot problem I mentioned above.
The laptops are the next post.