Skip to content

joryirving/home-ops

Repository files navigation

🚀 My Home Operations Repository 🚧

... managed with Flux, Renovate, and GitHub Actions 🤖

Discord   Talos   Kubernetes   Flux   Renovate

Home-Internet   Status-Page   Plex

Age-Days   Uptime-Days   Node-Count   Pod-Count   CPU-Usage   Memory-Usage   Power-Usage   Alerts


Overview

This is a monorepository is for my home kubernetes clusters. I try to adhere to Infrastructure as Code (IaC) and GitOps practices using tools like Terraform, Kubernetes, Flux, Renovate, and GitHub Actions.

The purpose here is to learn k8s, while practicing Gitops.


⛵ Kubernetes

My Kubernetes clusters are deployed with Talos. One is a low-power utility cluster, running important services, and the other is a semi-hyper-converged cluster, workloads and block storage are sharing the same available resources on my nodes while I have a separate NAS with ZFS for NFS/SMB shares, bulk file storage and backups.

There is a template over at onedr0p/cluster-template if you want to try and follow along with some of the practices I use here.

Core Components

  • actions-runner-controller: self-hosted Github runners
  • cert-manager: creates SSL certificates for services in my cluster
  • cilium: eBPF-based networking for my workloads.
  • cloudflared: Enables Cloudflare secure access to my routes.
  • external-dns: automatically syncs DNS records from my cluster ingresses to a DNS provider
  • external-secrets: managed Kubernetes secrets using 1Password.
  • rook-ceph: Cloud native distributed block storage for Kubernetes
  • sops: managed secrets for Talos, which are committed to Git
  • spegel: stateless cluster local OCI registry mirror
  • tofu-controller: additional Flux component used to run Terraform from within a Kubernetes cluster.
  • volsync: backup and recovery of persistent volume claims

GitOps

Flux watches the clusters in my kubernetes folder (see Directories below) and makes the changes to my clusters based on the state of my Git repository.

The way Flux works for me here is it will recursively search the kubernetes/${cluster}/apps folder until it finds the most top level kustomization.yaml per directory and then apply all the resources listed in it. That aforementioned kustomization.yaml will generally only have a namespace resource and one or many Flux kustomizations (ks.yaml). Under the control of those Flux kustomizations there will be a HelmRelease or other resources related to the application which will be applied.

Renovate watches my entire repository looking for dependency updates, when they are found a PR is automatically created. When some PRs are merged Flux applies the changes to my cluster.

Directories

This Git repository contains the following directories under Kubernetes.

📁 kubernetes
├── 📁 apps              # app configurations
│   ├── 📁 base          # base app configuration
│   ├── 📁 main          # cluster specific overlay
│   ├── 📁 utility
├── 📁 clusters          # Cluster flux configurations
│   ├── 📁 main
│   ├── 📁 utility
├── 📁 components        # re-useable components

Networking

Click to see a high-level network diagram dns

☁️ Cloud Dependencies

While most of my infrastructure and workloads are self-hosted I do rely upon the cloud for certain key parts of my setup. This saves me from having to worry about two things. (1) Dealing with chicken/egg scenarios and (2) services I critically need whether my cluster is online or not.

The alternative solution to these two problems would be to host a Kubernetes cluster in the cloud and deploy applications like HCVault, Vaultwarden, ntfy, and Gatus. However, maintaining another cluster and monitoring another group of workloads is a lot more time and effort than I am willing to put in.

Service Use Cost
1Password Secrets with External Secrets ~$80/yr$
Cloudflare Domain, DNS, WAF and R2 bucket (S3 Compatible endpoint) ~$30/yr
GitHub Hosting this repository and continuous integration/deployments Free
Healthchecks.io Monitoring internet connectivity and external facing applications Free
Total: ~$3/mo

🌐 DNS

In my cluster there are two instances of ExternalDNS running. One for syncing private DNS records to my UDM-SE using ExternalDNS webhook provider for UniFi, while another instance syncs public DNS to Cloudflare. This setup is managed by creating ingresses with two specific classes: internal for private DNS and external for public DNS. The external-dns instances then syncs the DNS records to their respective platforms accordingly.


🔧 Hardware

Main Kubernetes Cluster

Name Device CPU OS Disk Local Disk Rook Disk RAM OS Purpose
Ayaka MS-01 i9-13900H 960GB NVMe 1TB NVMe 1.92TB U.2 128GB Talos k8s control-plane
Eula MS-01 i9-13900H 960GB NVMe 1TB NVMe 1.92TB U.2 128GB Talos k8s control-plane
Ganyu MS-01 i9-13900H 960GB NVMe 1TB NVMe 1.92TB U.2 128GB Talos k8s control-plane

OS Disk: m.2 Samsung PM9A3 960GB Local Disk: m.2 WD SN770 1TB Rook Disk: u.2 Samsung PM9A3 1.92TB

Total CPU: 60 Cores/60 Threads Total RAM: 384GB

Utility Kubernetes Cluster

Name Device CPU OS Disk Local Disk RAM OS Purpose
Celestia Bosgame P1 Ryzen 7 5700U 500GB SSD 1TB NVMe 32GB Talos k8s control-plane

OS Disk: 2.5" Samsung 870 EVO SSD Local Disk: m.2 WD SN770 1TB

Total CPU: 8 Cores/16 Threads Total RAM: 32GB

Supporting Hardware

Name Device CPU OS Disk Data Disk RAM OS Purpose
Voyager MS-01 i5-12600H 32GB USB 6x400GB Raidz2 96GB Unraid NAS/NFS/Backup
DAS Lenovo SA120 - - 6x14TB Raidz2 - - ZFS
Venti Raspberry Pi5 Cortex A76 250GB NVMe - 8GB Raspbian NUT/SSH (Main)
Sayu Raspberry Pi5 Cortex A76 500GB NVMe - 8GB Raspbian NUT/SSH (Utility)
PiKVM Raspberry Pi4 Cortex A72 64GB mSD - 4GB PiKVM (Arch) KVM (Main)
JetKVM JetKVM RV1106G3 8GB EMMC - 256MB Linux 5.10 KVM (Utility)
PDU UniFi USP PDU Pro - - - - - PDU
TESmart 8 port KVM - - - - - Network KVM

Networking/UPS Hardware

Device Purpose
Unifi UDM-SE Network - Router
Back-UPS 600 Network - UPS
Unifi USW-Enterprise-24-PoE Server - 2.5G Switch
Unifi USW-Aggregation Server - 10G Switch
Tripp Lite 1500 Server - UPS

⭐ Stargazers

Star History Chart


🤝 Thanks

Big shout out to the cluster-template, and the Home Operations Discord community. Be sure to check out kubesearch.dev for ideas on how to deploy applications or get ideas on what you may deploy.

About

Wife tolerated HomeOps driven by Kubernetes, and Gitops via Flux.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 22