Bootstrapping a 6-Node HA kubeadm Cluster on WSL2 with Terraform
Notes on wiring up Multipass VMs, HAProxy, and kubeadm into a repeatable, Terraform-driven cluster on WSL2.
I wanted a homelab cluster that actually looked like production — multiple control-plane nodes, a load balancer in front of the API server, and infrastructure defined in code instead of a pile of shell scripts I'd forget how to run in a month. This post walks through the shape of the setup.
Why kubeadm instead of k3s or minikube
Managed dev clusters hide exactly the parts I wanted to practice: certificate rotation, etcd
topology, and how the control plane behaves when a node disappears. kubeadm keeps all of that
visible.
The Terraform layer
Multipass VMs are provisioned declaratively, with cloud-init handling the base packages so every node starts from the same known state. The pattern I settled on:
- A
modules/vmmodule parameterized by role (control-plane/worker) - Remote state kept local for now, with a documented path to a remote backend
- Outputs feeding directly into the Ansible-free
kubeadm init/kubeadm joinsteps
What I'd change next
The biggest gap right now is automated etcd backups and a proper tflint / Terratest pass before
I call this "production-grade" rather than "production-shaped." Both are next on the list.
Similar posts
My Week with Terraform
A study log covering the exam's real weak points — multi-container pods, probes, and the speed you need under the clock.
What CKAD Actually Tests (and How I'm Studying for It)
A study log covering the exam's real weak points — multi-container pods, probes, and the speed you need under the clock.
Teaching Assembly to Second-Years Without Losing the Room
What actually works when you're teaching low-level material to students who've only ever written Python.
Wanna have a coffee chat?
Let’s connect over a 30 minute call to chat about DevOps, sustainable tech, collaborating on a project, or just to swap book recommendations.
Let’s have a sip!