Skip to content

Configuration for my home Raspberry Pi Kubernetes cluster

Notifications You must be signed in to change notification settings

davejbax/home-pi-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Pi Cluster

Home Pi Cluster logo

An immutable infrastructure & GitOps approach to a home Kubernetes cluster. This is largely an experiment for fun and learning, with the following aims:

  • Immutable infrastructure: servers should never be changed or need to be changed ater deployment of an image. That is, there should be no need to SSH in and run commands, no need to run Ansible on existing hosts, and no configuration drift: what you see is what you flashed.
  • Entirely configured in code: the configuration of the cluster, workloads, and servers should be entirely managed by and reproducible from the code in this repo.
  • Hands-free install: after flashing a built image to the server's USB stick/SSD, there should be no more steps required by a human whatsoever; it should simply start running the Kubernetes node with all the workloads defined in this repo.
  • Self-upgrading: servers should upgrade themselves automatically when a new server image is released, without the need for a human to disconnect their USB drive/SD card and reflash it.
  • Suitable for running on Raspberry Pis: to keep power consumption low, the cluster must be capable of running solely on Raspberry Pi 3/4s.
  • Horizontally autoscaling: using Zigbee smart plugs, the cluster should be able to turn on/off extra nodes (Pis) automatically, as needed

Prerequisites

  • QEMU:

    apt install -y \
      qemu-user-static \
      binfmt-support \
      qemu-utils
  • Packer

  • Ansible

  • packer-builder-arm (forked)

    mkdir -p ~/.config/packer/plugins
    git clone https://github.com/davejbax/packer-builder-arm
    cd packer-builder-arm
    go mod download
    go build -o ~/.config/packer/plugins/packer-builder-arm
  • resize2fs >= v1.47.1

    • Required due to Ubuntu base image needing EXT4_FEATURE_COMPAT_ORPHAN_FILE

External setup

Building

foo@bar:~$ cd packer
foo@bar:~$ ./build.sh server # or 'agent' to build an agent image

About

Configuration for my home Raspberry Pi Kubernetes cluster

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published