Skip to content
Public template

About

HomeOps driven by Kubernetes and GitOps using Flux

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

ย 

History

5,429 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ F9's Homelab ๐Ÿšง

... managed with Flux, Renovate, Doco-CD and GitHub Actions ๐Ÿค–

Talosย ย  Kubernetesย ย  Fluxย ย  Renovateย ย  Ask DeepWiki


๐Ÿ’ก Overview

This is a mono repository for my home infrastructure: a Talos Kubernetes cluster and a separate Docker host. I try to adhere to Infrastructure as Code (IaC) and GitOps practices using tools like Talos, Kubernetes, Flux, Doco-CD, Renovate, and GitHub Actions. The layout follows onedr0p/home-ops, and all secrets are stored in 1Password and never committed to Git.


๐ŸŒฑ Kubernetes

My Kubernetes cluster is deployed with Talos on three control-plane nodes that also run workloads. This is a semi-hyper-converged cluster: workloads and block storage share the same resources on my nodes, while a separate TrueNAS server provides NFS/SMB shares, bulk file storage and backups.

Core Components

GitOps

Flux watches the kubernetes folder and makes changes to my cluster based on the state of this Git repository.

Flux recursively searches the kubernetes/apps folder until it finds the top-level kustomization.yaml in each directory and applies all the resources listed in it. That kustomization.yaml generally only contains a namespace resource and one or more Flux kustomizations (ks.yaml). Under the control of those Flux kustomizations there will be a HelmRelease or other resources related to the application.

Renovate watches my entire repository looking for dependency updates, and when it finds one it opens a pull request. When PRs are merged, Flux applies the changes to my cluster.

Directories

๐Ÿ“ kubernetes
โ”œโ”€โ”€ ๐Ÿ“ apps       # applications, grouped by namespace
โ”œโ”€โ”€ ๐Ÿ“ components # re-usable kustomize components (backups, alerts, GPU, ...)
โ””โ”€โ”€ ๐Ÿ“ flux       # flux system configuration

Flux Workflow

This is a high-level look at how Flux deploys my applications with dependencies. In most cases a Kustomization depends on other Kustomizations. The example below shows that immich will not be deployed or upgraded until cloudnative-pg and csi-driver-nfs are installed and healthy.

graph TD
    A>Kustomization: cloudnative-pg] -->|Creates| B[HelmRelease: cloudnative-pg]
    C>Kustomization: csi-driver-nfs] -->|Creates| D[HelmRelease: csi-driver-nfs]
    E>Kustomization: immich] -->|Creates| F(HelmRelease: immich)
    E -->|Depends on| A
    E -->|Depends on| C
Loading

๐Ÿ”ฎ Repository Structure

๐Ÿ“ .
โ”œโ”€โ”€ ๐Ÿ“ bootstrap  # takes fresh Talos nodes to a cluster Flux manages (helmfile + kustomize)
โ”œโ”€โ”€ ๐Ÿ“ docker     # compose stacks for my Docker host, deployed by Doco-CD
โ”œโ”€โ”€ ๐Ÿ“ kubernetes # everything Flux manages
โ”œโ”€โ”€ ๐Ÿ“ talos      # Talos machine configuration (templates and schematic)
โ”œโ”€โ”€ ๐Ÿ“ .github    # workflows, labels and issue templates
โ””โ”€โ”€ ๐Ÿ“ .mise      # pinned tool versions (mise)

Everyday tasks are wrapped in just recipes, and tool versions are pinned with mise. Run just to list the recipes.

Talos

Machine configuration lives in talos as composable multi-document templates: cluster.yaml.j2 applies to every node, controlplane.yaml.j2 to control-plane nodes, and nodes/<role>/<node>.yaml.j2 holds per-node settings. Secrets are op:// references resolved with op inject at render time. See the Talos README for details.

just talos render-config <node>   # render a node's machine config
just talos apply-node <node>      # render and apply it
just talos upgrade-node <node>    # upgrade Talos on a node

Bootstrap

bootstrap takes freshly installed Talos nodes to a cluster that Flux manages on its own. It applies the Talos config, bootstraps Kubernetes, installs the base CRDs and secrets, and syncs a helmfile of core apps (cilium, coredns, spegel, cert-manager, external-secrets, 1Password Connect, Flux). Flux then takes over.

Prerequisites: run mise install, sign in to the 1Password CLI (op), and have a valid talosconfig at the repo root.

just bootstrap cluster

Note

The Cilium BGP peering with my UniFi gateway is documented in kubernetes/apps/kube-system/cilium.


๐Ÿฌ Docker

A few workloads that need dedicated hardware, or that I want running independently of the cluster, run as Docker Compose stacks on my TrueNAS server. These are AI workloads (llama.cpp, Whisper, Immich machine learning), Frigate NVR, Proxmox Backup Server, CUPS, a Brother scanner Scan-button service that feeds Paperless, and a few exporters.

Doco-CD watches the docker folder and deploys the stacks listed in .doco-cd.yaml based on the state of this repository. Doco-CD runs as a stack of its own (docker/system/doco-cd) and updates itself when Renovate's image bump is merged.


๐Ÿ˜ถ Cloud Dependencies

Most of my infrastructure and workloads are self-hosted, but I rely on the cloud for a few key parts of my setup. Note that some of these are not part of this repo but are things I use alongside it.

Service Use Cost
1Password Secrets with External Secrets ~$40/yr
Cloudflare Domain, DNS and Tunnel ~ยฃ6/yr
GCP Voice interactions with Home Assistant over Google Assistant Free
GitHub Hosting this repository and continuous integration/deployments Free
Discord Alerts and notifications Free
Pushover Kubernetes alerts and application notifications $5 OTP

๐ŸŒŽ DNS

Two instances of ExternalDNS run in the cluster. One syncs private DNS records to my UniFi gateway using the ExternalDNS webhook provider for UniFi, and the other syncs public DNS records to Cloudflare. Records are created from routes attached to one of two gateways: envoy-internal for private DNS and envoy-external for public DNS.


โš™ Hardware

Compute

Dell OptiPlex 3060 ร— 3 ยท Intel Core i5-8500T (6 cores) ยท 64 GB RAM ยท 2.5 GbE ยท Talos / Kubernetes

  • OS โ€” 480 GB Intel SATA SSD
  • Rook-Ceph โ€” 256 GB Toshiba NVMe

Storage

TrueNAS server for NFS/SMB shares, bulk file storage, backups and the Docker stacks above.

Networking

  • UniFi Cloud Gateway Fibre โ€” router and BGP peer for Cilium

๐Ÿ™ Gratitude and Thanks

Thanks to the Home Operations Discord community and to onedr0p/home-ops, which this repository's structure follows. Be sure to check out kubesearch.dev for ideas on how to deploy applications.

About

HomeOps driven by Kubernetes and GitOps using Flux

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages