homelab-setup
homelab-setup copied to clipboard
trafficstars
Homelab Setup
This project is the "configuration as code" for my homelab environment. The project goal is to simplify management, updates, and configuration changes for every service running on my home network so that I don't get bogged down with day 2 operations (preventing me from focusing on my other projects). This document describes the steps required to (re)deploy each service from scratch.
Table of Contents
- Router
- Gitea
- Nextcloud
- Harbor
- Kubernetes
- OctoPi
Router
- Install OpenBSD 6.7
- Enable SSH
- Setup passwordless SSH
mkdir ~/.ssh chmod 700 ~/.ssh vi ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys - Install Python
pkg_add python-3.8.2 - Run router Ansible role
make router
Gitea
- Provision a VM
- 1 CPU
- 1 GB memory
- 8 GB disk
- Install Debian 10
- Disable GUI
- Disable print server
- Enable SSH
- Setup passwordless SSH
mkdir ~/.ssh chmod 700 ~/.ssh nano ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys - Install sudo
apt install sudo usermod -aG sudo <user> - Run gitea Ansible role
make gitea - Create gitea user
gitea --config /etc/gitea/app.ini admin create-user \ --username <user> \ --password password \ --email <email> \ --must-change-password \ --admin - Log in, setup SSH keys, GPG keys, repos, etc.
Nextcloud
- Provision a VM
- 1 CPU
- 2 GB memory
- 64 GB disk
- Install Debian 10
- Disable GUI
- Disable print server
- Enable SSH
- Setup passwordless SSH
mkdir ~/.ssh chmod 700 ~/.ssh nano ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys - Install sudo
apt install sudo usermod -aG sudo <user> - Run nextcloud Ansible role
make nextcloud - Complete installation with web UI
- Install "Deck" App
Harbor
- Provision a VM
- 2 CPU
- 4 GB memory
- 128 GB disk
- Install Debian 10
- Disable GUI
- Disable print server
- Enable SSH
- Setup passwordless SSH
mkdir ~/.ssh chmod 700 ~/.ssh nano ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys - Install sudo
apt install sudo usermod -aG sudo <user> - Run harbor Ansible role
make harbor - Log in to web UI and change admin password
- Configure Docker client to trust private CA
sudo mkdir -p /etc/docker/certs.d/harbor.mydomain.com/ sudo vim /etc/docker/certs.d/harbor.mydomain.com/ca.crt
Kubernetes
- Provision 6 VMs
- 2 CPU
- 7 GB memory
- 32 GB disk
- Install Debian 10
- Disable GUI
- Disable print server
- Enable SSH
- Setup passwordless SSH
mkdir ~/.ssh chmod 700 ~/.ssh nano ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys - Install sudo
apt install sudo usermod -aG sudo <user> - Run k8s Ansible role
make k8s - (optional) Copy ~/.kube/config to local machine
mkdir ~/.kube chmod 770 ~/.kube scp [email protected]:~/.kube/config ~/.kube/config
OctoPi
- Install OctoPi
- Configure WiFi by editing
octopi-wpa-supplicant.txton the root partition - Connect to Raspberry Pi
ssh [email protected] # password: raspberry - Edit system settings
sudo raspi-config # change password # set locale (under Localisation) # set timezone (under Localisation) - Change root user password
sudo su - passwd - Create user account
adduser <user> usermod -aG sudo <user> - Setup passwordless SSH for user
mkdir .ssh chmod 700 .ssh touch .ssh/authorized_keys chmod 600 .ssh/authorized_keys vi .ssh/authorized_keys - Run homelab-setup ansible playbook
make octopi