Skip to content

Bare-Metal Host Preparation

This tutorial guides you through preparing a physical machine (node legion) running Ubuntu 26.04 LTS to serve as a Kubernetes node.

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.

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:

Terminal window
sudo mkdir -p /home/k3s-storage
sudo chmod 0777 /home/k3s-storage

Add the mount to /etc/fstab to persist it across reboots:

UUID=<storage-partition-uuid> /home/k3s-storage ext4 defaults,noatime 0 2

Step 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:

Terminal window
sudo apt update
sudo apt install -y nvidia-driver-580

Reboot the node to initialize the NVIDIA kernel module:

Terminal window
sudo reboot

After rebooting, verify driver initialization:

Terminal window
nvidia-smi

The output confirms the GPU model, driver version, and CUDA version.

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.

Terminal window
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
tailscale ip -4

Use the address from tailscale ip -4 for ansible_host, k3s_node_ip, and k3s_external_ip in the inventory.

With the bare-metal host installed, networked, and storage mounted, proceed to Ansible Configuration to define cluster inventory variables.