Prerequisites
Before you begin, ensure you have the following installed:Docker
Docker Desktop or Docker Engine running on your machine
talosctl
The Talos CLI tool (see Installation)
kubectl
Kubernetes CLI for cluster interaction
Create Your First Cluster
Let’s create a local Talos cluster with the default configuration.Create the cluster
Run the following command to create a Docker-based Talos cluster:This command will:
- Create a Docker network for the cluster
- Launch container nodes (1 control plane, 0 workers by default)
- Generate machine configurations
- Apply configurations to nodes
- Save the Talos configuration to
~/.talos/config
Sample output
Sample output
The cluster creation process typically takes 2-3 minutes. Talos will automatically configure networking, bootstrap etcd, and initialize Kubernetes.
Customize cluster configuration (optional)
You can customize the cluster with additional flags:
Common flags
Common flags
| Flag | Description | Default |
|---|---|---|
--workers | Number of worker nodes | 0 |
--controlplanes | Number of control plane nodes | 1 |
--cpus-controlplanes | CPU allocation for control planes | 2.0 |
--memory-controlplanes | Memory for control planes (bytes) | 2GB |
--cpus-workers | CPU allocation for workers | 2.0 |
--memory-workers | Memory for workers (bytes) | 2GB |
--kubernetes-version | Kubernetes version to install | Latest stable |
--name | Cluster name | talos-default |
--image | Talos container image | Latest release |
Bootstrap the cluster
After the cluster is created, bootstrap etcd to initialize Kubernetes:The bootstrap process:
The
bootstrap command initializes the etcd cluster on the control plane node. This step is automatically performed by talosctl cluster create, but you can run it manually if needed.- Initializes a single-node etcd cluster
- Configures etcd to accept additional members
- Enables other control plane nodes to join
Verify cluster health
Check that your cluster is healthy:Expected output:You can also check individual components:
Retrieve the kubeconfig
Get the Kubernetes configuration to interact with your cluster:This command:
- Downloads the admin kubeconfig from the control plane
- Merges it with your existing
~/.kube/config(by default) - Sets the new cluster as the current context
Kubeconfig options
Kubeconfig options
What Just Happened?
When you rantalosctl cluster create, the following occurred:
Network Setup
Network Setup
- Created a Docker network named
talos-default - Allocated a subnet (default:
10.5.0.0/24) - Reserved IP addresses for nodes and the Kubernetes API endpoint
PKI Generation
PKI Generation
- Generated certificates for mutual TLS authentication
- Created service account tokens
- Generated Kubernetes PKI materials
- Saved credentials to
~/.talos/config
Node Provisioning
Node Provisioning
- Pulled the Talos container image
- Created Docker containers for each node
- Applied machine configurations via the API
- Configured control plane and worker roles
Cluster Bootstrap
Cluster Bootstrap
- Bootstrapped etcd on the first control plane node
- Initialized the Kubernetes control plane
- Started kubelet on all nodes
- Deployed core Kubernetes components
Managing Your Cluster
Now that your cluster is running, explore common management tasks:View Cluster Information
View Logs
Interactive Dashboard
Node Operations
Deploy a Sample Application
Test your cluster by deploying a simple application:For Docker-based clusters, you’ll need to use port forwarding or configure exposed ports to access services from your host machine.
Cleaning Up
When you’re done, destroy the cluster:- Stops and removes all Docker containers
- Deletes the Docker network
- Cleans up cluster state files
Troubleshooting
Cluster creation fails with network errors
Cluster creation fails with network errors
Ensure Docker is running and has network access. Check that the default subnet doesn’t conflict with existing networks:
Nodes stuck in 'NotReady' state
Nodes stuck in 'NotReady' state
Check node logs for issues:Verify network connectivity between nodes:
Bootstrap command fails
Bootstrap command fails
Ensure etcd service is running:If the cluster was already bootstrapped, you’ll see an error. You only need to bootstrap once.
Cannot access cluster with kubectl
Cannot access cluster with kubectl
Verify the kubeconfig was retrieved correctly:If needed, re-fetch the kubeconfig:
Next Steps
Congratulations! You’ve successfully created your first Talos Linux cluster. Here’s what to explore next:Configuration
Learn how to customize machine configurations and cluster settings.
Production Deployment
Deploy Talos on bare metal, VMs, or cloud platforms for production use.
Networking
Configure CNI, load balancers, and network policies.
Storage
Set up persistent storage for your workloads.
Additional Resources
- Talos CLI Reference: Complete
talosctlcommand documentation - Machine Configuration: Detailed guide on machine config options
- Cluster Management: Advanced cluster operations and maintenance
- Security: Hardening and security best practices