Prerequisites
To create a Kubernetes cluster with Talos, you’ll need to:-
Install talosctl:
talosctl
is the CLI tool used to interact with the Talos API. Since Talos Linux does not have SSH access,talosctl
is the primary tool for managing and configuring your Talos machines You can installtalosctl
on macOS or Linux by running:
- Ensure network access: Your machines will need internet access to download the Talos installer and container images, sync time, and more. If you’re working in a restricted network environment, check out the official documentation on using registry proxies, local registries, or setting up an air-gapped installation.
Talos Cluster Setup Overview
Every Talos cluster follows the same process, regardless of where you deploy it:- Boot - Start machines with the Talos Linux image
- Configure - Create a root of trust certificate authority and generate configuration files
- Apply - Apply machine configurations to the nodes
- Connect - Set up your local
talosctl
client - Bootstrap - Initialize the Kubernetes cluster.
Step 1: Download The Talos Linux Image
Get the latest ISO for your architecture from our Image factory.Step 2: Boot Your Machine
Boot your hardware using the ISO you just downloaded. At this stage, you’ll:- Boot one machine as your control plane node.
- Boot additional machines as worker nodes (this is optional).
Step 3: Store Your Node IP Addresses in a Variable
To create variables for your machines’ IP addresses:- Copy the IP address displayed on each machine console, including the control plane and any worker nodes you’ve created. If you don’t have a display connected, retrieve the IP addresses from your DHCP server.
-
Create a variable for your control plane node’s IP address by replacing
<your-control-plane-ip>
with the actual IP: -
If you have worker nodes, store their IP addresses in a Bash array.
Replace each
<worker-ip>
placeholder with the actual IP address of a worker node. You can include as many IP addresses as needed:
Step 4: Unmount the ISO
Unplug your installation USB drive or unmount the ISO. This prevents you from accidentally installing to the USB drive and makes it clearer which disk to select for installation.Step 5: Learn About Your Installation Disks
When you first boot your machine from the ISO, Talos runs temporarily in memory. This means that your Talos nodes, configurations, and cluster membership won’t survive reboots or power cycles. However, once you apply the machine configuration (which you’ll do later in this guide), you’ll install Talos, its complete operating system, and your configuration to a specified disk for permanent storage. Run this command to view all the available disks on your control plane:sda
, vda
) as you will use it in the next step.
Step 6: Generate Cluster Configuration
Talos Linux is configured entirely using declarative configuration files avoiding the need to deal with SSH and running commands. To generate these declarative configuration files:-
Define variables for your cluster name and the disk ID from step 5.
Replace the placeholders with your actual values:
-
Run this command to generate the configuration file:
- controlplane.yaml: The configuration for your control plane.
- worker.yaml: The configuration for your worker nodes.
- talosconfig: Your
talosctl
configuration file, used to connect to and authenticate access to your cluster.
Step 7: Apply Configurations
Now that you’ve created your configurations, it’s time to apply them to bring your nodes and cluster online:-
Run this command to apply the control plane configuration:
-
Next, apply the worker node configuration:
Step 8: Set your endpoints
Set your endpoints with this:Step 9: Bootstrap Your Etcd Cluster
Wait for your control plane node to finish booting, then bootstrap your etcd cluster by running:Step 10: Get Kubernetes Access
Download yourkubeconfig
file to start using kubectl
.
You have two download options: you can either merge your Kubernetes configurations OR keep them separate.
Here’s how to do both:
- Merge your new cluster into your local Kubernetes configuration:
- Specify a filename if you prefer not to merge with your default Kubernetes configuration:
Step 11: Check Cluster Health
Run the following command to check the health of your nodes:Step 11: Verify Node Registration
Confirm that your nodes are registered in Kubernetes:Next Steps
Congratulations! You now have a working Kubernetes cluster on Talos Linux. For a list of all the commands and operations thattalosctl
provides, see the CLI reference.