25/12/2024
A not so complicated single node homelab
Some background
It's amazing what all the services on the internet can do. But what if, just what if, you can do it yourself?
As a Operations Engineer in a tech company, it's easy to be ambicious on what you could achieve. But it's not always easy trying to make changes on company infrastructure, so this is where homelab comes in.
Considerations
We want the homelab to closely resemble a production environment, but at the same time keep the Hardware requirement and set up as simple as possible. There are a few things to consider
Functionality requirements
Accessibility from internet
Load Balancing
Local domain names
Kubernetes / DB / Standalone App Servers
Simplicity requirements
Minimum hardware requirement
Use existing home broadband
No change to existing home network
Result
The end result of the system architecture:
Single Physical host HyperVisor (VMWare)
Advantages
Small footprint
No need for dedicated network equipment (operate with vSwitch/soft router only)
Can use consumer grade (even 2nd hand) equipments
Disadvantages
Need to take entire infrastructure offline for maintainance
Single point of failure
Not able to replicate failover (can simulated with VMs)
Soft router gateway on VM (PFSense)
Advantages
Segregated LAN via vSwitch
Load Balancing capability
DNS resolver
Disadvantages
Need to be booted before all other VM for other VMs to have a gateway
Tunnel to VPS as internet incoming traffic Gateway
Advantages
Public IP accessible from Internet (CGNAT penetrating)
additional Transport/Networking layer firewall capability
Hide home IP address from internet
Disadvantages
Bandwidth costs money
Additional latency
Additional computational cost
Note, alternatively we can use Cloudflare tunnel with cloudflared as proxy. This is a more mature solution with easier setup, however is more limited if you want to perform some edge operations
Some other possible systems
All VMs under Home Router
Advantages
Dedicated network device, network won't go down during Host maintainance
Access to VMs from home device
Disadvantages
Shared network with other home device
Home router bottleneck
Cloudflared on each application server
Advantages
Easiest to implement - no need for any form of router
Mature solution, works out of the box
Secure - only internet exposure is via Cloudflare
Disadvantages
Not selfhosted not fun
Each server needs to set up their own cloudflared