My K3S

Updated: September 28, 2024

k3s is best for creating a lightweight rpi cluster.

These are the steps used for creating my k3s pi cluster which contains
3 control nodes and 4 workers (stacked HA cluster)


Table of Contents

Gather Facts

Commands to find necessary information.
EEPROM:

# get UUID information
blkid

# current EEPROM version
vcgencmd bootloader_version

# man page
rpi-eeprom-update -h

# check if update is available
sudo rpi-eeprom-update

# install the update
sudo rpi-eeprom-update -a

# read current EEPROM configuration
rpi-eeprom-config  # or
vcgencmd bootloader_config

# read from an EEPROM image
pri-eeprom-config pieeprom.bin

Hardware

  1. Use Raspberry Pi Imager to install ubuntu or raspbianOS then SSH in:
  1. SSH back into the sd card:
  1. Install git and rpi-clone
  1. Connect USB || NVME SSD to RPI
  1. Shutdown pi4, disconnect all power, unplug SD, plug power back in, verify
  1. Check where you are booting from:

Test Write && Read

dd if=/dev/zero of=./speedTestFile bs=20M count=5 oflag=direct
dd if=./speedTestFile of=/dev/zero bs=20M count=5 oflag=dsync
Performance SD Card USB NVME
Write 32 MB/s 253 MB/s
Read 45 MB/s 263 MB/s

If ethernet keeps droping it may be issue with EEE (energy efficient ethernet)

# check eee status
ethtool --show-eee eth0

# turn eee off
sudo ethtool --set-eee eth0 eee off

Rest of setup can be done with ansible

  1. Set networking
  2. Establish SSH
  3. Install dependencies for kubernetes
  4. Configure cgroup driver

sudo rfkill block wifi
sudo rfkill block bluetooth

The Chosen

Calico # pod network
Traefik # load balancer
Glusterfs # storage volume
Helm # package manager
Prometheus # collect metric data
Grafana # visualize Prometheus data