Skip to content

A small self-hosted kubernetes cluster on the shelf in my office

Notifications You must be signed in to change notification settings

brettinternet/cluster

Repository files navigation

Kubernetes Pi Cluster

Lint

pi 4 cluster

Features

Hardware

I'm using Raspberry Pi 4 (x 5) but the 4 GB RAM models are hungry for more memory. Micro SD cards are insufficient for etcd's demanding read/writes, so I recommend SATA over USB 3.0. Check out this guide for compatible interfaces. I use a PicoCluster case.

Software

Setup and usage is inspired heavily by this homelab gitops template and the k8s-at-home community. You can find similar setups with the k8s at home search. See my other homelab setups.

Looking for a simpler devops experience? Checkout my docker deployment at brettinternet/homelab.

Setup

Dependencies

Install go-task

Install dependencies and setup environment:

task init

Provision

Then, provision your infrastructure:

task ansible:{init,list,ping,setup,install,status}

DNS and Tunnel

Setup a Cloudflare Tunnel.

cloudflared tunnel login
cloudflared tunnel create cluster

Add the tunnel's credentials.json to the value in cloudflared-secret and tunnel ID to cluster-secrets.sops.yaml.

Add a Cloudflare API token with these permissions to the value in external-dns-secret.

  • Zone - DNS - Edit
  • Account - Cloudflare Tunnel - Read

Deploy

Kubernetes

Verify flux can be installed. Then, push changes to remote repo and install.

task flux:{verify,install}

Push latest to repo - you can use the wip.sh script for that with task wip.

task flux:reconcile
task kubernetes:resources

Most deployments in this repo use an app-template chart with these configuration options.