skip to content
Succeeded With Errors

Asgard 1: Build One Node, Design for Four

/ 11 min read

Table of Contents

Two days after I found out I’d burned 1,239 GitHub Actions minutes in a single afternoon, I was answering a quiz about Norse gods.

The pipeline fix from that afternoon worked. The budget came out at around 1,400 of the 2,000 free minutes a month, with headroom. But the number that stuck with me wasn’t the budget. It was that I now had a budget at all, for compute, when there is a shelf in my office with nothing on it. Every minute a runner spent installing Chromium was a minute I was paying for, in a currency I’d only just learned existed, to do work a small computer on that shelf could do for the cost of electricity.

So on the twenty-ninth of October I started a new repository and called it HomeLab. This is the first post in a series about what went into it. The series runs alongside the Orrery posts, and it’s the one where I buy things, print things, and occasionally measure things I should have measured first.

What I Wanted From It

Three workloads on day one, and I wrote them down before I looked at a single product page.

Self-hosted GitHub Actions runners. The Orrery repo runs an agent team that opens a lot of pull requests, and each one costs minutes. A runner on my own hardware costs nothing per minute. There’s a catch I logged as an open question on day one: the hardware I had in mind is ARM64, so any job that only runs on x86 can’t move. I don’t yet know how many of mine that is.

MercNet. The Starfinder campaign app from the Orrery series. It currently lives on a small cloud VM, and I’d like the table to be served from something I can touch.

FamilyFirst. A family app with a Postgres database that currently lives on my desktop PC. Whether the database moves onto the cluster or stays on the PC until there’s real storage is another open question; it decides what backups look like in the next phase.

Later, maybe: Plex, DNS with ad blocking, Home Assistant, Vaultwarden, Uptime Kuma. Plex I wanted on day one and had to talk myself out of, which I’ll get to.

The existing gear inventory was short. A Bambu Lab 3D printer. That’s the list. No managed switch, no router that speaks VLANs, no spare machines. Everything else would be bought, and I’d be buying it for a design I hadn’t drawn yet.

The Quiz

I ran the kickoff as a quiz. A fixed list of questions, each answered in a sentence, written down before any research happened. The point was to make the decisions before I’d fallen in love with a particular switch, so that the hardware would have to fit the answers rather than the other way round. The answers, more or less as recorded:

QuestionAnswer
CodenamesThe Asgard set
Node hardwareRaspberry Pi 5 8GB with a PoE+ HAT, four nodes eventually
BudgetNot fixed. Build one node first, design for four
Day-one workloadsActions runners, MercNet, FamilyFirst
IsolationA dedicated lab router and PoE switch; the lab is its own subnet
WifiNone of its own. Devices stay on home wifi and the lab router lets them in
Existing gearThe printer
Remote accessTailscale for admin, a Cloudflare tunnel for the family-facing apps
Printed partsA full 10-inch mini rack plus Pi sleds
StorageLocal NVMe per node now, a NAS later
Build vs buyAdopt off-the-shelf first, build only for gaps
Phase 1Router, switch, one node, k3s, one runner, MercNet over Tailscale, rack printed

Two of those answers turned out to be the whole design. “Build one node first, design for four” became the rule that every later decision gets tested against. “Adopt first” is what stopped me from writing a lab control plane, which I would absolutely have enjoyed and which would have shipped nothing.

The out-of-scope list was as useful as the in-scope one. Plex transcoding on a Pi is out; Plex waits for a NAS or a mini-PC with hardware transcode, which is its own later phase. Bulk storage is out; nodes get a local drive. A separate lab wifi network is out. A custom control plane is out until I’ve lived with the off-the-shelf tooling through three phases and found real gaps. And a highly available control plane is out: one server node until there are at least three, because an HA setup with two nodes is a way to spend a weekend.

Why Asgard

The quiz offered three codename sets: Bramble, Asgard, and Drift. I picked Asgard in about a second, for a reason that has nothing to do with the hardware. The agent team I use for Orrery is already named after the Aesir, so the Norse vocabulary was already in my head and in my prompts. A name set I already speak is one less thing to translate.

NameWhat it is
AsgardThe whole project and the lab network
BifrostThe lab router and firewall. The only path in or out
HeimdallThe PoE+ switch. Watches the gate; every node hangs off it
YggdrasilThe k3s cluster
root-01 to root-04The nodes
ValhallaThe 3D-printed rack everything lives in
MimirThe monitoring stack, later
NidhoggThe future NAS, gnawing at the roots

The one wrinkle: Mimir is also one of my agents. In the lab repo, Mimir always means monitoring, and I wrote that down in the decision record because I know I’ll forget. The node names are root-NN on purpose: growing past four keeps the pattern without a rename.

The Isolation Model

This is the decision I spent the most time on, because it’s the one that’s hardest to change later, and it’s the one with the most wrong turns on the way to the answer.

The constraint: the lab has to be isolated from the home network, but reachable from any device on the home wifi without those devices installing anything. And I own no VLAN-capable gear.

VLANs on the existing router. The textbook answer. Requires gear that does VLANs. I don’t have any, and buying a new home router to get them would mean redoing the home network to build a lab, which is backwards.

A flat network. Put the Pis on the home LAN and call it a day. No isolation at all, which fails the first requirement. I’d be running GitHub’s job payloads on the same subnet as the TV.

Tailscale only. Every lab service reachable over the tailnet, nothing published locally. Clean, and it means every family member installs Tailscale on every device to open a family app. The whole point of a family app is that the family doesn’t install things.

A dedicated lab router. What I went with. Bifrost is a small router whose WAN port plugs into the home LAN, exactly as if the home network were its internet. Behind it is one lab subnet with its own DHCP and DNS. Bifrost’s firewall allows home-LAN clients to reach published service addresses and nothing else, and admin traffic goes over Tailscale, with the subnet router running on Bifrost itself. Family-facing apps get a Cloudflare tunnel, so the family reaches them by a normal hostname from anywhere with no client software.

The consequences I accepted, written down at the time:

  • Double NAT. The lab sits behind Bifrost’s NAT, which sits behind the home router’s NAT. That’s fine because nothing is port-forwarded; everything inbound comes through Tailscale or the tunnel.
  • Bifrost is a single point of failure. If it dies, the lab is unreachable. The documented fallback is a spare Pi 5 running OpenWrt.
  • A lab wifi network later is an access point on Heimdall, not a redesign.

The wrong turn that wasn’t a design choice: to write real firewall rules I needed to know the home LAN’s subnet, and at kickoff I didn’t have it to hand. It went on the open-questions list and stayed there for two days, until I read it off the PC. Two days is nothing, except that the firewall config was the first thing I wanted to write, and I wrote it with a placeholder in it.

The Rule

Every choice must survive growing to four nodes. Not “should scale”. Must survive, meaning that when root-04 arrives, nothing bought or printed or configured for root-01 gets thrown away.

That rule did real work in the first week, and you’ll see each of these in later posts:

  • The PoE switch is sized for four nodes at a 25 W planning ceiling each, which rules out every switch with four PoE ports and every switch with a budget in the sixties or seventies, however nice they are for one node.
  • The rack starts at 6U and grows by stacking a section on top; nothing below gets rebuilt.
  • The cluster runs one server node until there are three, and the bootstrap scripts are written so that adding a node is a runbook, not a project.
  • The budget was costed as “one node now” and “each additional node” as separate numbers, so I know what four costs before I’ve bought one.

The counterpart to the rule is that I only buy for one. Order one node’s parts, assemble them, measure the thing I can’t look up (how tall the board stack actually is with the HAT and drive on it), and only then order the rest. The rack’s sled design has that height as a parameter with a placeholder value and a note saying it’s unverified, because it is.

The Roadmap, and Where It Stands

Phases, each ending with something working and documented, and nothing in a later phase starts before the previous phase’s done list is checked:

  • Phase 0, design. Scope, codenames, the decision log, hardware chosen, a costed bill of materials, the rack parametrised, test prints.
  • Phase 1, one root. Bifrost online, Heimdall powering root-01 over PoE, k3s on one node, one Actions runner picking up an ARM64 job, MercNet reachable over Tailscale, the rack printed and holding the hardware, and a runbook that rebuilds root-01 from scratch in under an hour.
  • Phase 2, family apps. Ingress and certificates, FamilyFirst and its database, the Cloudflare tunnel, nightly backups with a tested restore.
  • Phase 3, grow. root-02 and root-03 by runbook, runner autoscaling, Mimir, the home services.
  • Phase 4, Nidhogg. Storage, Plex, root-04 if the load justifies it.

As I write this, on the second of November, phase 0 is nearly done and phase 1 has started. Bifrost came online today: WAN on the home LAN, lab subnet up, default-deny inbound, the lab can reach the internet, and the Tailscale route is approved. Heimdall has its first configuration and its cloud features turned off. root-01’s parts arrive today. The k3s bootstrap scripts and the Flux GitOps layout are written and have never been run, because there’s nothing to run them on yet. The rack’s test kit is printed in PLA, with an empty results table, because the heat-set inserts and the PETG got delayed about a week, so the cluster will come up on a desk before it has a home.

I’m fine with that order. The cluster doesn’t depend on the case.

What I’d Take From This

Answer the quiz before you open a product page. Every hardware decision I made in the following week was checked against a list I’d written when I didn’t yet want anything in particular. The list won every argument.

Design for the number you’ll reach. Buy for the number you have. Four nodes shaped the switch, the rack and the cluster layout. One node is what’s in the mail. The gap between those is where the measuring happens.

Isolation is a box, not a setting. Without VLAN gear, the honest options were a flat network or a second router. The second router costs double NAT and a single point of failure, and both of those were cheaper than the alternatives.

Pick names you already speak. It sounds trivial. It’s the difference between a vocabulary you use and one you look up.

Keep the open questions as a list, not a blocker. The home subnet, the database placement, the runner scope, the stack height: none of them stopped the design. All of them are written down with what they affect and what happens if the answer is bad.

A router with a firewall, a switch with no nodes on it, a box of parts on the doorstep, and scripts that have never run. Succeeded with errors.


Next in the series: picking the gate, the switch and the rails, including the switch I chose, un-chose a day later, and why that was the right call.