---
title: "Homelab"
description: "Peter Cappetto's homelab: a Kubernetes cluster built from scratch on Raspberry Pis, with an AI agent as a hands-on tutor."
canonical_url: "https://www.petercappetto.com/projects/homelab"
source_url: "https://www.petercappetto.com/projects/homelab"
---
# Homelab

My homelab is a three-node Kubernetes cluster I built from scratch on Raspberry Pis. I have used Kubernetes at work, but I had never built and administered a cluster myself. I wanted a place to do that where the cost of failure is small.

The cluster is live; you can see all three nodes’ vitals at [vitals.petercappetto.com](https://vitals.petercappetto.com). The nodes run as a DaemonSet and form a BEAM cluster using libcluster. I wrote this in Elixir and use LiveView to do realtime updates. The application code is available at [https://github.com/pcapp/pi-cluster-vitals](https://github.com/pcapp/pi-cluster-vitals).

## Agentic Teaching

Coding agents tend to jump into problem solving mode and fix problems, but I wanted the agent to serve as a teacher and guide instead. I built agentic infrastructure like AGENTS.md and teaching skills to prevent immediate problem solving. I used [Hermes](https://hermes-agent.nousresearch.com/) and had the agent self-improve at the end of every session by asking it to reflect on how it can improve.

### Key Points:

- **Lesson Structure** The agent gives me background and references on a topic before handing me any commands. The lesson include links to relevant documentation that I can use while executing the lesson tasks.
- **Hands-on commands rather than automation** I started off using Ansible, but I moved to executing commands manually on the command line. In normal situations, I would codify procedures with scripts and IaC, but I kept things basic with core Linux system administration done by hand. I liken this to learning a language or music where repetition reinforces learning.
- **Readable commands** The lesson planner writes flags out in long form instead of a string of terse switches. Again, this reinforced learning the commands and intention.
- **Memory across sessions** The system keeps notes on the cluster and my progress in a wiki it can read back, so each session picks up where the last one ended.

## Checking my work

The most important part is that the agent verifies my work. After I make a change, it inspects the cluster and tells me whether I got it right. That feedback loop is what turns a list of instructions into actual learning.

The agent works under guardrails of its own, too. It starts read-only, previews changes with dry runs before anything is applied, asks before anything destructive, and doesn’t report a task as done until it has actually tested the result.

## What’s running

- Three Raspberry Pis running upstream Kubernetes, installed with kubeadm
- Cilium for eBPF-based pod networking, and ingress-nginx for routing
- A public path from the internet through Caddy and a WireGuard tunnel into the cluster
- [vitals](https://vitals.petercappetto.com), a small Elixir app that shows the cluster’s temperature

## Moving from Calico to Cilium

The cluster started out on Calico. I later migrated it to Cilium, and now its networking is entirely Cilium and eBPF. Cilium also replaced kube-proxy, so service load balancing runs in eBPF too. That took some effort. I initially transitioned one node at a time, but I ended up briefly taking the cluster down for an hour to finish the switch.
