Home

Awesome

<div align="center"> <img src="https://raw.githubusercontent.com/onedr0p/home-ops/main/docs/src/assets/logo.png" align="center" width="144px" height="144px"/>

<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.gif" alt="šŸš€" width="16" height="16"> My Home Operations Repository <img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a7/512.gif" alt="šŸš§" width="16" height="16">

... managed with Flux, Renovate, and GitHub Actions <img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f916/512.gif" alt="šŸ¤–" width="16" height="16">

</div> <div align="center">

DiscordĀ Ā  TalosĀ Ā  KubernetesĀ Ā  Renovate

</div> <div align="center">

Home-InternetĀ Ā  Status-PageĀ Ā  Alertmanager

</div> <div align="center">

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

</div>

<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f4a1/512.gif" alt="šŸ’”" width="20" height="20"> Overview

This is a mono repository for my home infrastructure and Kubernetes cluster. I try to adhere to Infrastructure as Code (IaC) and GitOps practices using tools like Ansible, Terraform, Kubernetes, Flux, Renovate, and GitHub Actions.


<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f331/512.gif" alt="šŸŒ±" width="20" height="20"> Kubernetes

My Kubernetes cluster is deployed with Talos. This is a semi-hyper-converged cluster, workloads and block storage are sharing the same available resources on my nodes while I have a separate server 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

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
ā”œā”€ā”€ šŸ“ main            # main cluster
ā”‚   ā”œā”€ā”€ šŸ“ apps           # applications
ā”‚   ā”œā”€ā”€ šŸ“ bootstrap      # bootstrap procedures
ā”‚   ā”œā”€ā”€ šŸ“ flux           # core flux configuration
ā”‚   ā””ā”€ā”€ šŸ“ templates      # re-useable components
ā”œā”€ā”€ šŸ“ shared          # shared cluster resources
ā””ā”€ā”€ šŸ“ ...             # other clusters

Flux Workflow

This is a high-level look how Flux deploys my applications with dependencies. Below there are 3 Flux kustomizations postgres, postgres-cluster, and atuin. postgres is the first app that needs to be running and healthy before postgres-cluster and once postgres-cluster is healthy atuin will be deployed.

graph TD;
  id1>Kustomization: cluster] -->|Creates| id2>Kustomization: cluster-apps];
  id2>Kustomization: cluster-apps] -->|Creates| id3>Kustomization: postgres];
  id2>Kustomization: cluster-apps] -->|Creates| id5>Kustomization: postgres-cluster]
  id2>Kustomization: cluster-apps] -->|Creates| id8>Kustomization: atuin]
  id3>Kustomization: postgres] -->|Creates| id4[HelmRelease: postgres];
  id5>Kustomization: postgres-cluster] -->|Depends on| id3>Kustomization: postgres];
  id5>Kustomization: postgres-cluster] -->|Creates| id10[Postgres Cluster];
  id8>Kustomization: atuin] -->|Creates| id9(HelmRelease: atuin);
  id8>Kustomization: atuin] -->|Depends on| id5>Kustomization: postgres-cluster];

Networking

<details> <summary>Click here to see my high-level network diagram</summary> <img src="https://raw.githubusercontent.com/onedr0p/home-ops/main/docs/src/assets/network-topology.png" align="center" width="600px" alt="dns"/> </details>

<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f636_200d_1f32b_fe0f/512.gif" alt="šŸ˜¶" width="20" height="20"> 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 three things. (1) Dealing with chicken/egg scenarios, (2) services I critically need whether my cluster is online or not and (3) The "hit by a bus factor" - what happens to critical apps (e.g. Email, Password Manager, Photos) that my family relies on when I no longer around.

Alternative solutions to the first two of these 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 would be more work and probably be more or equal out to the same costs as described below.

ServiceUseCost
1PasswordSecrets with External Secrets~$65/yr
CloudflareDomain and S3~$30/yr
GCPVoice interactions with Home Assistant over Google AssistantFree
GitHubHosting this repository and continuous integration/deploymentsFree
MigaduEmail hosting~$20/yr
PushoverKubernetes Alerts and application notifications$5 OTP
UptimeRobotMonitoring internet connectivity and external facing applications~$58/yr
Total: ~$20/mo

<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f30e/512.gif" alt="šŸŒŽ" width="20" height="20"> DNS

In my cluster there are two instances of ExternalDNS running. One for syncing private DNS records to my UDM Pro Max 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.


<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/2699_fe0f/512.gif" alt="āš™" width="20" height="20"> Hardware

<details> <summary>Click here to see my server rack</summary> <img src="https://raw.githubusercontent.com/onedr0p/home-ops/main/docs/src/assets/rack.png" align="center" width="200px" alt="dns"/> </details>
DeviceNumOS Disk SizeData Disk SizeRamOSFunction
ASUS NUC 14 Pro CU 5 125H31TB SSD1TB (local) / 800GB (rook-ceph)96GBTalosKubernetes
PowerEdge T34011TB SSD8x22TB ZFS (mirrored vdevs)64GBTrueNAS SCALENFS + Backup Server
PiKVM (RasPi 4)164GB (SD)-4GBPiKVMKVM
TESmart 8 Port KVM Switch1----Network KVM (for PiKVM)
UniFi UDMP Max1-2x12TB HDD--Router & NVR
UniFi US-16-XG1----10Gb Core Switch
UniFi USW-Enterprise-24-PoE1----2.5Gb PoE Switch
UniFi USP PDU Pro1----PDU
APC SMT1500RM2U1----UPS

<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f31f/512.gif" alt="šŸŒŸ" width="20" height="20"> Stargazers

<div align="center">

Star History Chart

</div>

<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f64f/512.gif" alt="šŸ™" width="20" height="20"> Gratitude and Thanks

Thanks to all the people who donate their time to 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 could deploy.