How to Build a Home Kubernetes Cluster (Step-by-Step 2025 Guide)


๐ Step-by-Step Setup
1. Flash Raspberry Pi OS
Use Raspberry Pi Imager to install Raspberry Pi OS Lite. Configure SSH access and Wi-Fi/Ethernet.
2. Install K3s on Each Node
On your master node:
bashCopyEditcurl -sfL https://get.k3s.io | sh -
Get the join token for worker nodes:
bashCopyEditsudo cat /var/lib/rancher/k3s/server/node-token
On each worker node, join them to the cluster:
bashCopyEditcurl -sfL https://get.k3s.io | K3S_URL=https://<MASTER_NODE_IP>:6443 K3S_TOKEN=<TOKEN> sh -
3. Configure MetalLB
Enable load balancing for your cluster by installing MetalLB:
bashCopyEditkubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml
Create a MetalLB ConfigMap to define the IP address pool:
yamlCopyEditapiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: my-ip-pool
namespace: metallb-system
spec:
addresses:
- 192.168.1.240-192.168.1.250
Apply it with:
bashCopyEditkubectl apply -f metallb-config.yaml
4. Secure with Tailscale
Install Tailscale on all nodes for secure VPN access to your cluster from anywhere.
On each node:
bashCopyEditcurl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
Once connected, you can access your cluster securely from any device.
๐ Next Steps: Add Monitoring
Set up Prometheus and Grafana for monitoring, or deploy test apps using Helm charts to validate your setup.
๐ Original Post: Build a Home Kubernetes Cluster (Subnet Savy)
Follow me here on Hashnode for more Kubernetes home lab guides and DevOps tips!
Subscribe to my newsletter
Read articles from Michael Woltz directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
