Homelab Infrastructure

My Homelab

21 November 2024
homelabnetworkingautomation
🚀
💻

Introduction

Welcome to my digital playground! 🎮 As a tech enthusiast, I've always been fascinated by the intersection of software and hardware. My journey began with a curious mind and a passion for technology that led me to build PCs 🖥️, wire homes 🔌, and set up security systems 🔒. Today, I'm excited to share my latest adventure: building a homelab in my basement. This space has become my personal tech sanctuary where I can experiment, learn, and create without limits ⚡.

🤖

What is a Homelab?

Before we dive into my specific homelab, we should cover what a homelab is for those who have never heard the term. It's a very broad inclusive term that refers to some sort of setup in your house that you can use to tinker, mess around with software or hardware, and generally experiment in the safe confines of your own home and network 🏠.

💡

This homelab can be as tiny as a single Raspberry Pi or old laptop, to something as big as a Home Data Center. The foundational concept is the same, however, it's some place at home to be able to mess around with tools and technologies for the purposes of learning and fun 🎯.

🛠️

What can I do with a Homelab?

You can do a lot with a homelab. Anything you want that your hardware can handle, which is actually probably more than you think. Raspberry Pi's are surprisingly capable little devices, and even really old hardware can run a lot of open source software on Linux 🐧.

🎯

Common Projects

  • 🛡️Setting up Pi-hole for network-wide adblocking
  • 🎬Running a Plex media server to host your own media
  • 🎮Set up a Raspberry Pi with RetroPie for retro gaming
  • 🏠Home automation with Home Assistant or Homebridge
  • 💻Custom code you write yourself to do whatever you'd like!

There are so many other things you can do, that list barely scratches the surface of the possibilities. Just find something that sounds cool and get started. There are likely even tutorials that walk you through it! 📚

🚀

Soon, I Will Build My Proxmox Cluster

Right now, I have two Proxmox nodes – PVE1 and Ahmed2 – and soon, I'll be setting them up as a Proxmox cluster! 🏗️ Before I start, I've mapped out the step-by-step process to make sure everything goes smoothly.

🌟

Why I'm Setting Up a Proxmox Cluster

  • High Availability (HA) – If one node fails, workloads can shift.
  • Easier Management – Control all nodes from one web interface.
  • Live Migration – Move VMs between nodes without downtime.
  • Shared Storage & Backups – A unified storage pool for all nodes.
🛠️

Step 1: Preparing Both Nodes

Before clustering, I need to ensure:

  • ✔️Both nodes run the same Proxmox VE version 🏷️
  • ✔️Both nodes have static IPs 🛜
  • ✔️Both nodes can ping each other by hostname 🔄
Planned Setup
Node Name
IP Address
Role
PVE1
192.168.1.10
Primary Node 🏠
Ahmed2
192.168.1.11
Second Node 🏗️
Verify Connectivity:
ping 192.168.1.10 # From Ahmed2
ping 192.168.1.11 # From PVE1
🔗

Step 2: Creating the Cluster

PVE1 Proxmox Node

Once everything is set, I'll initialize the cluster on PVE1:

pvecm create my-cluster

💡 This will create a new cluster named my-cluster and make PVE1 the master.

🏗️

Step 3: Adding Second Node

Ahmed2 Proxmox Node

On Ahmed2, I'll run:

pvecm add 192.168.1.10

🔄 This will connect Ahmed2 to PVE1 and sync configurations.

Step 4: Verifying the Cluster

To confirm both nodes are in the cluster, I'll check the status:

pvecm status

At this point, both nodes should show up, and I'll have a working Proxmox cluster! 🎉

🔥

Future Plans: Enabling HA

Once my cluster is up, I'll look into setting up automatic VM failover. I may add:

  • A third node for better stability
  • A qdevice (like a Raspberry Pi) to prevent quorum issues
Enable HA for a VM:
ha-manager add vm:100 --state started

This will allow a VM to restart on another node if one goes down. ⚡

🚀

Here's My Kubernetes Homelab: Lenovo ThinkCentre + Raspberry Pis

Hey everyone! 👋 Today, I'm sharing how I built my K3s Kubernetes cluster using a Lenovo ThinkCentre M710q Tiny as the control plane and Raspberry Pis as worker nodes. This setup is perfect for learning Kubernetes on a budget. Later, I'll repurpose the Lenovo as a firewall using pfSense or OPNsense!

🎯

Why This Setup?

I wanted a dedicated Kubernetes cluster separate from my Proxmox homelab. My goals:

  • Lightweight & Budget-Friendly – Using refurbished hardware
  • Low Power Consumption – Ideal for 24/7 uptime
  • Scalable – Start small, expand later
  • Real-World Learning – Running cloud-native tools like Longhorn, MinIO, and ArgoCD
🛠

Hardware for My Kubernetes Cluster

🖥️

Control Plane (Master Node)

💻 Lenovo ThinkCentre M710q Tiny (Refurbished)
  • • CPU: Intel Core i3-6100T @ 3.2GHz
  • • RAM: 16GB DDR4
  • • Storage: 256GB SSD
  • • OS: Ubuntu Server 22.04 LTS
🍓

Worker Nodes (Raspberry Pis)

  • • Raspberry Pi 4 (4GB RAM)
  • • Raspberry Pi 3 (2GB RAM)
  • • microSD Cards (32GB+)
  • • Raspberry Pi OS Lite / Ubuntu Server 22.04
🌐

Networking Setup

  • • Gigabit Ethernet Switch (Optional but recommended)
  • • Tailscale (for secure remote access)
🔥

Step 1: Installing Ubuntu Server on the Lenovo ThinkCentre

📌 Why Ubuntu? It's stable, lightweight, and well-supported for Kubernetes.

sudo nano /etc/netplan/50-cloud-init.yaml
Example static IP configuration:
network:
  ethernets:
    eth0:
      addresses:
        - 192.168.1.100/24
      gateway4: 192.168.1.1
      nameservers:
        addresses: [8.8.8.8, 1.1.1.1]
  version: 2
sudo netplan apply
🏗️

Step 2: Installing K3s on the Control Plane

📌 Why K3s? It's a lightweight, easy-to-manage Kubernetes distribution.

curl -sfL https://get.k3s.io | sh -
systemctl status k3s
sudo cat /var/lib/rancher/k3s/server/node-token
🍓

Step 3: Setting Up Raspberry Pi Worker Nodes

📌 Why Raspberry Pi? Low-power, cheap, and great for learning Kubernetes.

curl -sfL https://get.k3s.io | K3S_URL="https://192.168.1.100:6443" K3S_TOKEN="YOUR_NODE_TOKEN" sh -
kubectl get nodes
📦

Step 4: Adding Kubernetes Tools

🗄️

Persistent Storage with Longhorn

helm repo add longhorn https://charts.longhorn.io
helm repo update
helm install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace
kubectl port-forward -n longhorn-system service/longhorn-frontend 8080:80
📈

Monitoring with Prometheus & Grafana

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace
kubectl port-forward svc/prometheus-grafana 3000:80 -n monitoring
📦

S3-Compatible Storage with MinIO

kubectl apply -f https://raw.githubusercontent.com/minio/operator/master/minio-tenant.yaml
kubectl port-forward svc/minio 9000:9000 -n minio
🔄

Automating with ArgoCD

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl port-forward svc/argocd-server -n argocd 8080:443
🔐

Step 5: Secure Remote Access with Tailscale

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
🎯

What's Next?

  • Deploy apps like Home Assistant, Uptime Kuma, or your own projects
  • Experiment with scaling and networking
  • Convert the Lenovo into a pfSense firewall once done!
🎉

Final Thoughts

That's it! I've built my K3s Kubernetes cluster using a Lenovo ThinkCentre M710q Tiny as the control plane and Raspberry Pis as worker nodes. This setup is perfect for learning cloud-native technologies, and when I'm done, I'll turn the Lenovo into a firewall.

💬 Got questions? Let's discuss! 🚀

⚙️

Homelab Services

🔧

LXC Containers

  • 🛡️
    Pi-hole

    Network-wide ad blocking and DNS management

  • 📊
    Grafana

    Metrics visualization and monitoring

  • 📈
    Prometheus

    Time series database for metrics

  • 🔍
    Sonarr

    TV show management and automation

  • 🎬
    Radarr

    Movie management and automation

  • 🎵
    Lidarr

    Music collection management

  • 📚
    Readarr

    Book collection management

  • 📥
    NZBGet

    Usenet downloader

  • 🔍
    Jackett

    Torrent tracker proxy

  • 📺
    Jellyfin

    Media server and streaming

🖥️

Virtual Machines

📊

Service Status Overview

🎬

Media Services

Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
📺Sonarr
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
🎬Radarr
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
🎵Lidarr
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
⚙️

Infrastructure

Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
🛡️pfSense
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
Status:Running
Uptime:99.9%
Storage:4TB
Transcoding:Hardware
📂

Project Repository

Homelab Infrastructure Documentation

Check out the complete documentation, scripts, and configuration files for my homelab setup