Skip to content

tomdewildt/homelab

Repository files navigation

Home Lab

Build License

This repository contains the configuration for my home lab servers and network.

How to run

Prerequisites:

  • vagrant version 2.2.7 or later
  • ansible version 2.8.5 or later
  • ansible-lint version 4.2.0 or later

Remote

  1. Run make run/remote to execute the playbook.

Virtual

  1. Run make vm/start to start the virtual machines.
  2. Run make run/virtual to execute the playbook.

Run make vm/stop to stop the virtual machines and make vm/remove to remove them.

Goals

The primary goals of this project are...

  • to have a highly-available home lab, with no SPOF (Single Point of Failure)
  • to have a production grade kubernetes cluster.
  • to learn and have fun.

In summary

I have 4 physical machines plugged into 1 switch. One server is used as a router/gateway, this server handles the IPv4 NAT, VLAN, DHCP, DNS and VPN. The other machines are used in a kubernetes cluster with one master and two workers.

I have one APC UPS that handles all the power for the system. It keeps all the gear running during a power outage. When the battery hits a critical level all the servers are gracefully shutdown using apcupsd.

Gear

Servers

  • 2x Dell PowerEdge R210 II
    • Intel Xeon X3460
    • 8GB RAM (DDR3-1333)
    • OS: 250GB 3.5 SATA HDD
    • Dell Power Supply 250W
  • 2x Dell PowerEdge R710
    • 2x Intel Xeon X5570 or 2x Intel Xeon X5560
    • 48GB RAM (DDR3-1333)
    • OS: 6x 300GB 3.5 SAS HDD in RAID 5
    • 2x Dell Power Supply 870W

Switches

Other

  • Old HP monitor
  • Old Dell keyboard and mouse combo

Power

The whole setup including all servers and switches draws about 530 watts idle.

ISP

Software

  • pfSense is the most popular, open-source firewall operating system based on FreeBSD.
  • Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.

Config

Network config

  • LAN is unused
  • VLAN10 10.10.0.0/24, is used for infrastructure (routers, switches, ups, etc).
  • VLAN20 10.20.0.0/24, is used for servers.
  • VLAN30 10.30.0.0/24, is used for management.
  • VLAN40 10.40.0.0/24, is used for DMZ services that need to be exposed to the internet.
  • VLAN50 10.50.0.0/24, is used for trusted clients.
  • VLAN60 10.60.0.0/24, is used for untrusted clients.

The VPN runs on the 10.70.0.0/24 subnet and the virtual cluster network for kubernetes on the 10.80.0.0/16 subnet.

References

pfSense VLAN

Dell PowerConnect Serial

Dell PowerConnect Factory Reset

Dell PowerConnect VLAN Setup

Dell PowerConnect Command Line Manual

APC UPS Serial

APC UPS Factory Reset

APC UPS Install Centos 7

Metallb VLAN Setup

CentOS USB

Container Runtimes

Create Cluster Kubeadm

Kubernetes With Firewalld

Calico Quickstart

Helm Quickstart

Vagrant Docs

Cert Manager Chart

Drone Chart

Ingress Chart

Local Path Provisioner Chart

Loki Chart

Promtail Chart

Metallb Chart

MongoDB Chart

PostgresSQL Chart

Prometheus Chart