Installing the Operating System

Prepare your Raspberry Pi nodes with a lightweight, 64-bit Linux OS ready for Kubernetes and K3s.

By Kevin McAleer,    3 Minutes

Page last updated May 24, 2025


Cover


To run K3s reliably on Raspberry Pi, you’ll need a clean, minimal 64-bit Linux OS — with a few key configuration tweaks.

In this lesson, we’ll walk through choosing an operating system, installing it on each Pi, and preparing for clustering.


OS Notes
Ubuntu Server 22.04+ Well-supported, minimal, 64-bit ARM
Raspberry Pi OS (64-bit Lite) Official, stable, but less minimal
DietPi or Arch Linux For advanced users, highly minimal

⚠️ Ensure you’re using a 64-bit image, not 32-bit — Kubernetes requires 64-bit support.


💽 Step 1: Flash the OS

Tools You Can Use:

Process:

  1. Download the 64-bit OS image (e.g., Ubuntu Server 22.04 LTS for ARM).
  2. Flash the image to each SD card or SSD.
  3. Enable SSH:
    • For Raspberry Pi OS: place an empty file named ssh in the /boot partition.
    • For Ubuntu Server: SSH is enabled by default.

🧑‍💻 Step 2: First Boot and Configuration

  1. Insert the card/SSD into each Pi.
  2. Power up and SSH in:

    ssh ubuntu@<pi-ip-address>
    

    Default password: ubuntu (you’ll be prompted to change it)

  3. Update the system:

    sudo apt update && sudo apt upgrade -y
    
  4. Set a hostname for each Pi:

    sudo hostnamectl set-hostname pi-master
    sudo reboot
    

Use consistent names like pi-master, pi-node1, pi-node2, etc.


🌐 Step 3: Set Static IP or DHCP Reservation

On your router:

  • Reserve an IP for each Raspberry Pi based on its MAC address
  • This ensures stable node communication in the cluster

Or manually edit netplan (Ubuntu):

network:
  ethernets:
    eth0:
      dhcp4: no
      addresses: [192.168.1.101/24]
      gateway4: 192.168.1.1
      nameservers:
        addresses: [1.1.1.1, 8.8.8.8]
  version: 2

Save to /etc/netplan/00-installer-config.yaml and apply:

sudo netplan apply

  • Enable cgroups (required for Kubernetes): Check /boot/firmware/cmdline.txt (Ubuntu) or /boot/cmdline.txt (Pi OS):

    Add or confirm:

    cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
    
  • Reboot:

    sudo reboot
    

🧪 Verify

After reboot, confirm:

  • You can SSH into all nodes
  • Hostnames are correct
  • Static IPs are assigned
  • cgroups are enabled

✅ Now your Pi cluster is ready for K3s installation!

Next up: Installing K3s


< Previous Next >

You can use the arrows  ← → on your keyboard to navigate between lessons.