A Talos cluster in Docker
This is the free lesson
Next: The API instead of a shell
The rest of this course is part of Pro, together with every other course and the ones added later.
$25 a month billed yearly, or $29 month to month
Until 30 November: $210 for the first year, or $14.50 for the first month, with code LAUNCH.
A free account keeps your progress across devices. The paid lessons need Pro.
Code Snippets
docker info --format '{{.KernelVersion}}'
talosctl version --client --short
talosctl cluster create docker --name talos-lab --workers 1 --host-ip 127.0.0.1
talosctl config contexts
kubectl config get-contexts
kubectl get nodes -o custom-columns=NAME:.metadata.name,VERSION:.status.nodeInfo.kubeletVersion,\
OS:.status.nodeInfo.osImage,KERNEL:.status.nodeInfo.kernelVersion,\
RUNTIME:.status.nodeInfo.containerRuntimeVersion
docker ps --filter label=talos.cluster.name=talos-lab --format 'table {{.Names}}\t{{.Ports}}'
docker exec talos-lab-worker-1 shIn this video you'll create a Talos Linux cluster on your Mac with one talosctl command, and see what it is made of. Talos Linux is an operating system that runs Kubernetes and nothing else. Here each Talos node is a container in Docker, inside Colima's Linux virtual machine, and it shares that machine's kernel. talosctl talks to the Talos API, an application programming interface, and kubectl to the Kubernetes API, both through ports published on localhost. In this lesson you will check the kernel and the tools, create a cluster, and find what talosctl wrote and started. Before you start, you need Colima, kubectl and talosctl, and a kernel 6.15 or newer in Colima's virtual machine. Ubuntu 24.04 ships 6.8, so install Ubuntu's hardware enablement kernel with the command shown, and restart the virtual machine. Docker runs in Colima's Linux virtual machine, and every container shares that machine's kernel. Talos 1.14 needs a kernel 6.15 or newer under its containers. Mine is 7.0, Ubuntu's hardware enablement kernel. Why care about the operating system under Kubernetes at all? Thilo Fromm, a maintainer of Flatcar Container Linux, a project of the Cloud Native Computing Foundation, spoke on udienza.com about why a platform team should still care about the host operating system. Talos takes that idea all the way. talosctl is the one tool Talos needs, a single binary, here version 1.14.6. One command creates a cluster. The docker subcommand runs every node as a container: a control plane and one worker, in a cluster named talos-lab. The host IP flag sets the IP, or internet protocol, address of its published ports: one two seven dot zero dot zero dot one only. talosctl generates the certificates and keys, starts the two containers, and bootstraps etcd, the database of the cluster. This takes almost two minutes, so I speed up the video. Each line is a check that talosctl waits for: etcd, the Talos API, the kubelet, the control plane pods, and at the end nodes that are ready and schedulable. Done. talosctl merged a kubeconfig into the file in my home folder, and printed a summary: the Docker network, ten dot five dot zero dot zero slash twenty-four, and the Kubernetes endpoint on a localhost port. talosctl also wrote its own client file, dot talos slash config, with a context named talos-lab. Its endpoint is the Talos API, port fifty thousand of the control plane, published on a localhost port. The nodes column is empty, so each command will name the node it talks to. kubectl got a context too, admin at talos-lab, and it is the current one. Now the nodes, with the columns I care about here. Two nodes, at Kubernetes 1.37.1. The operating system is Talos 1.14.6, the container runtime is containerd 2.3.7, and the kernel is the virtual machine's, because these nodes are containers. Two containers. Only the control plane publishes ports: six four four three for Kubernetes and fifty thousand for the Talos API, both on one two seven dot zero dot zero dot one. On most Linux nodes, the next step would be a shell. Here is that attempt on the worker container. There is no shell to start. Talos has no shell, no SSH, the secure shell, and no package manager. Every node is managed through its API, with talosctl, and that API is all this cluster needs. In this lesson you learned that Talos 1.14 in Docker needs a kernel 6.15 or newer, that cluster create writes a talosctl context and merges a kubectl one, and that each node is a container with no shell inside.