Creating a multinode Kubernetes cluster from a single Raspberry Pi 4

Setup a Kubernetes cluster on a single Raspberry Pi 4, using KVM and k3s

Not all tools 'just work' for SoC systems

Having decided to learn Kubernetes, I purchased a Rasperry Pi 4 (4GB) to create a dedicated machine / cluster to experiment and learn on. I figured I could use a simple tool to create a few VMs, and create a trivial cluster; however multipass would not spin up VMs on my Pi. I didn't want to buy another Pi, so I started down the path of creating worker nodes via KVM/QEMU.

I'd like to share the steps I've taken to create (technically, perhaps not practically) a Kubernetes cluster with only one Raspberry Pi board.

These are the required steps, at a high level

  1. Flash a Micro SD card with Ubuntu Server 19.10 for Raspberry Pi
  2. Set up the server node (the Raspberry Pi itself)
  3. Handle k8s-related considerations for the server node
    • virtualization, container features, bridged networking
  4. Install VMs via virt-install / the qemu hypervisor
  5. Install k3s:
    • on server node, then
    • on VM nodes

Also, a few links to article that've helped me setup my RPi cluster; if you're an author of any of these and you happen to be reading this - thank you!!!

Flash the SD card

Server node considerations before installing Kubernetes

Install a few VMs

where the first arg, $1, will be the name of the KVM guest, and the second will be the .iso image to install the guest OS. I recommend ubuntu-19.10-server-arm64.iso

Install Kubernetes via k3s

If all's gone well, you've setup a proper Kubernets cluster with just one Raspberry Pi board!

cluster running