Runbook: Adding a Server¶
Adding a k3s Worker¶
1. Add to Inventory¶
Edit ansible/inventory/hosts.yaml and add the new host:
2. Add Host Secrets¶
Edit the encrypted inventory secrets:
Add the new host's connection details:
k3s-w1:
ansible_host: <tailscale-ip>
ansible_user: <user>
ansible_ssh_private_key_file: <path-to-key>
3. Enroll in Tailscale¶
If the server isn't yet on Tailscale, run provision first:
4. Run the Cluster Playbook¶
This will run prerequisites and install the k3s agent, which registers the server with the cluster automatically using the shared token from k3s_cluster.sops.yml.
5. Validate¶
Adding a Raspberry Pi¶
Same steps as above, but also add the host to the raspberries group:
The k3s.orchestration.raspberrypi role (run as part of the cluster playbook) handles Pi-specific tweaks: cgroup memory configuration in /boot/cmdline.txt.
Removing a Server¶
1. Drain and delete from Kubernetes¶
2. Uninstall k3s (optional)¶
3. Remove from inventory¶
Remove the host from ansible/inventory/hosts.yaml and hosts_secrets.sops.yaml.