Bare-Metal Host Preparation
Host Preparation
Section titled “Host Preparation”This tutorial guides you through preparing a physical machine (node legion) running Ubuntu 26.04 LTS to serve as a Kubernetes node.
Step 1: Install Ubuntu 26.04 LTS
Section titled “Step 1: Install Ubuntu 26.04 LTS”Install Ubuntu 26.04 LTS Server on the machine. During installation:
- Select standard OpenSSH server installation.
- Connect the machine to your local network. DHCP is fine, because the cluster uses the node’s Tailscale IP rather than its LAN address.
- Set the hostname to
legion.
Step 2: Prepare the local storage mount
Section titled “Step 2: Prepare the local storage mount”The homelab uses K3s built-in Local-Path Provisioner. Workloads persist their data to /home/k3s-storage, which should reside on a dedicated high-speed SSD or NVMe partition.
Format the partition with ext4 or xfs and mount it to /home/k3s-storage:
sudo mkdir -p /home/k3s-storagesudo chmod 0777 /home/k3s-storageAdd the mount to /etc/fstab to persist it across reboots:
UUID=<storage-partition-uuid> /home/k3s-storage ext4 defaults,noatime 0 2Step 3: Install NVIDIA GPU drivers (Optional for GPU Nodes)
Section titled “Step 3: Install NVIDIA GPU drivers (Optional for GPU Nodes)”If your bare-metal node includes an NVIDIA GPU (such as the GeForce GTX 1050 Ti on legion), install the proprietary NVIDIA driver:
sudo apt updatesudo apt install -y nvidia-driver-580Reboot the node to initialize the NVIDIA kernel module:
sudo rebootAfter rebooting, verify driver initialization:
nvidia-smiThe output confirms the GPU model, driver version, and CUDA version.
Step 4: Install and join Tailscale
Section titled “Step 4: Install and join Tailscale”Install Tailscale and join the node to your tailnet. Provisioning fails early if Tailscale is missing, because K3s uses the Tailscale IP as the node IP.
curl -fsSL https://tailscale.com/install.sh | shsudo tailscale uptailscale ip -4Use the address from tailscale ip -4 for ansible_host, k3s_node_ip, and k3s_external_ip in the inventory.
Step 5: Next steps
Section titled “Step 5: Next steps”With the bare-metal host installed, networked, and storage mounted, proceed to Ansible Configuration to define cluster inventory variables.