What is Talos Linux?
Talos Linux is a modern, secure, and minimal Linux distribution designed specifically for Kubernetes. Unlike traditional Linux distributions, Talos is:- Immutable: The OS cannot be modified at runtime, ensuring consistency
- API-managed: All configuration is done via a declarative API
- Minimal: Only includes what’s necessary to run Kubernetes
- Secure by default: No SSH, no shell, reduced attack surface
Prerequisites
1. Control Machine Setup
You need a Linux machine (physical, VM, or WSL2) to orchestrate the deployment. This machine will NOT be part of the cluster; it’s just your workstation. Install talosctl (Talos CLI):2. Prepare Cluster Nodes
You need physical or virtual machines with Talos Linux installed. For this guide, we’ll assume:- 1 control plane node: Will run the Kubernetes control plane and etcd
- 2 worker nodes: Will run your application workloads
- 2+ CPU cores (4 recommended)
- 4GB RAM (8GB recommended for control plane)
- 50GB+ disk space
- Network connectivity between all nodes
Getting Your Talos Factory Image
Talos uses a “factory” system to generate custom installation images with system extensions (drivers, plugins, etc.). You need to determine which image matches your hardware.Step 1: Visit the Talos Image Factory
Go to https://factory.talos.dev/Step 2: Select System Extensions (if needed)
Common extensions include:- qemu-guest-agent: For Proxmox/QEMU VMs
- iscsi-tools: For iSCSI storage
- siderolabs/util-linux-tools
Step 3: Copy Your Image Identifier
The factory will generate an installer URL that looks like:Environment Configuration
Now let’s set up your environment variables. These will be used throughout the deployment process. for a highly available cluster you should have 3 control plane nodes Open a terminal and export these variables (adjust IPs to match your infrastructure):Step-by-Step Deployment
Step 1: Generate Cluster Configuration Files
Talos needs configuration files that define how each node should behave. We’ll generate these now.talosctl gen configcreates three files:controlplane.yaml: Configuration for control plane nodesworker.yaml: Configuration for worker nodestalosconfig: Authentication credentials for managing the cluster
- The
--install-imageflag tells Talos which image to use (with your hardware-specific extensions) - The cluster endpoint URL (
https://$CONTROL_PLANE_IP:6443) is where kubectl will connect
- Talos generated cryptographic certificates for secure communication
- Created machine configurations with your cluster name and endpoint
- Generated credentials for you to manage the cluster
talosctl commands to authenticate with your cluster.
Step 2: Apply Configuration to Control Plane Nodes
Now we’ll push the control plane configuration to each control plane node. This tells them they’re control plane nodes and gives them their identity.--insecureflag: Required on first boot because nodes don’t have certificates yet--nodes: Specifies which node to configure--file: The configuration file to apply- After applying, each node will reboot to apply the configuration
Step 3: Apply Configuration to Worker Nodes
Same process, but for worker nodes. These nodes will run your application workloads. Execute:Step 4: Bootstrap the Cluster
This is the critical step where we initialize etcd and start Kubernetes. This must only be done once per cluster. Select one control plane node (in our case we only have one)- We’re telling
talosctlwhich node to communicate with (the first control plane node) - The
bootstrapcommand initializes etcd on this node - etcd is the distributed database that stores all Kubernetes state
- Other control plane nodes will automatically join the etcd cluster
- Kubernetes control plane components will start
talosctl bootstrap more than once. Running it again will destroy your etcd cluster and you’ll lose all data. If you accidentally run it twice, you’ll need to wipe all nodes and start over.
What’s happening in the background:
- First control plane node starts etcd
- etcd creates the initial cluster state
- Kubernetes API server starts
- Controller manager and scheduler start
- Other control plane nodes detect the running cluster and join
- Worker nodes connect to the API server and join as compute nodes
Step 5: Retrieve Kubeconfig
Now we need the kubeconfig file sokubectl can communicate with your cluster.
- Talos generates a kubeconfig file with admin credentials
- This file contains the cluster endpoint and authentication certificates
- kubectl will use this to communicate with the Kubernetes API
Understanding What We Built
Architecture Overview
Your cluster now has: Control Plane Node (1):- Running etcd (distributed database)
- Running Kubernetes API server
- Running scheduler (assigns pods to nodes)
- Running controller manager (maintains desired state)
- Running kubelet (node agent)
- Running container runtime
- Ready to run your application pods
- Flannel CNI for pod networking