Skip to content

Latest commit

 

History

History
79 lines (55 loc) · 3.36 KB

README.md

File metadata and controls

79 lines (55 loc) · 3.36 KB

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