Skip to content

Add Worker Node to K3s Cluster

Use this guide to add a bare-metal Ubuntu worker node to an existing K3s cluster.

Install Ubuntu 26.04 LTS on the new machine. Configure a static LAN IP address, verify network connectivity to the control-plane node legion, and install your SSH public key for passwordless sudo access.

Log in to the control plane node legion to retrieve the K3s node join token:

Terminal window
ssh sudhanva@100.66.139.118 "sudo cat /var/lib/rancher/k3s/server/node-token"

Store this token securely for agent registration.

Add the new machine to ansible/inventory/hosts.yaml under the k3s_agents group:

k3s_agents:
hosts:
worker-01:
ansible_host: WORKER_TAILSCALE_IP
ansible_user: sudhanva
k3s_node_ip: "WORKER_TAILSCALE_IP"

Replace WORKER_TAILSCALE_IP with the output of tailscale ip -4 on the worker. Every node uses its Tailscale IP as the node IP, so nodes reach each other and the API server over the tailnet regardless of LAN addressing.

If the node features an NVIDIA GPU, add the node label gpu.nvidia.com/present=true under node variables so the GPU Operator can manage it.

Run the Ansible playbook targeting the new worker node:

Terminal window
ansible-playbook -i ansible/inventory/hosts.yaml ansible/site.yaml --limit worker-01

Ansible installs system prerequisites, configures kernel modules and sysctl parameters, installs the K3s agent binary, and registers the node with the control plane.

Verify from your workstation that the new node has joined and reports Ready:

Terminal window
kubectl get nodes -o wide

Check that the Flannel CNI pod is running on the new node:

Terminal window
kubectl get pods -n kube-system -o wide