The entire Kubernetes cluster state as code — rolled out purely via Git.
Single Source of Truth for my self-hosted homelab on Talos Linux, continuously reconciled by FluxCD. GitHub is leading; Forgejo is an in-cluster mirror.
New here? Start with
docs/cluster-access.mdto get a kubeconfig, thendocs/applications.mdto learn how to enable / disable apps and configure their hostnames.
- How it works
- Infrastructure Overview
- Applications & Status
- Infrastructure Principles
- Repository Structure
- Development Environment (Nix Shell)
- Secrets (SOPS + age)
- Bootstrap & Recovery
- Governance
- Further Documentation
git push ──▶ GitHub (main) ──▶ FluxCD ──▶ Kustomize / Helm ──▶ Talos Cluster
│
└─▶ SOPS + age decrypt secrets in-cluster
Everything is declarative: the cluster's desired state lives in this repo,
Flux reconciles it every hour (or on demand). Changes land via PRs to
main — never kubectl edit.
| Component | Technology | Role |
|---|---|---|
| VCS / Mirror | GitHub (Primary) + Forgejo (Mirror) | GitHub is leading; Forgejo is in-cluster mirror. |
| Secrets | SOPS + age | Encrypted GitOps secrets (in-repo encryption) |
| OS & K8s | Talos Linux | Immutable, RAM-based, API-managed OS |
| GitOps | FluxCD | Reconciles Git state to cluster state |
| CNI | Cilium + Hubble | eBPF pod network (VXLAN), NetworkPolicy enforcement, flow visibility; kube-proxy stays |
| Storage (DB) | node-local local-path |
Per-node disks for CloudNativePG (off the iSCSI SPOF; CNPG replicates at the DB layer) |
| Storage (Fast) | TrueNAS iSCSI (democratic-csi) | RWO block storage for app state/config |
| Storage (Mass) | NFS (External NAS) | Persistent storage for media and archives |
| Networking | NGINX Ingress / ExternalDNS | Ingress control and Cloudflare DNS sync |
| Security | cert-manager | Automated TLS via Let's Encrypt (DNS-01) |
| Observability | VictoriaMetrics Stack | High-performance monitoring and alerting |
| Automation | Renovate Bot | Automated dependency and image updates |
| Data Policy | Velero + Restic | On-site Kubernetes recovery plus encrypted Immich/Nextcloud offsite backups |
This cluster runs a variety of self-hosted applications. Uptime is monitored
via Gatus (— = no Gatus check).
| Application | Description | Uptime |
|---|---|---|
| audiobookshelf | Audiobook & podcast streaming server | |
| authentik | Central SSO & identity provider (OIDC) | |
| dawarich | Self-hosted location history (Google Timeline alternative) | |
| forgejo | In-cluster Git forge & mirror of GitHub | |
| gatus | Status page & uptime monitoring (source of these badges) | — |
| goloom | Plan & schedule social-media posts (Mastodon, Bluesky, …) | |
| grafana | Metrics dashboards & visualization | |
| Hister | Private full-text search for visited pages and files | |
| Hubble | Cilium network flow & policy-verdict UI (admins, via Authentik) | |
| homelable | Homelab topology map (external host, proxied via ingress) | — |
| homepage | Central start page / service dashboard | |
| homer | Static services dashboard | |
| immich | Self-hosted photo & video backup | |
| immich-power-tools | Bulk management add-on for Immich | — |
| IT-Tools | Developer utilities (via Authentik proxy) | |
| jellyfin | Movie & TV media server | |
| kavita | Ebook, comic & manga reader | |
| kite | Kubernetes web dashboard | |
| linkding | Minimal bookmark manager | |
| n8n | Workflow automation & integrations | |
| navidrome | Music library server (Subsonic/OpenSubsonic API), feeds Music Assistant | |
| nextcloud | File sync, share & collaboration | |
| Outline | Team wiki & knowledge base | |
| paperless-gpt | LLM-based OCR, titling & tagging for paperless-ngx | — |
| paperless-ngx | Document management with OCR & archiving | |
| readeck | Read-it-later & web article archive | |
| searxng | Privacy-respecting metasearch engine | |
| SparkyFitness | Fitness & nutrition tracker | |
| SpectrumKNX | KNX bus monitor for smart-home | |
| Stirling-PDF | Browser-based PDF toolbox | |
| tandoor | Recipe manager & meal planner | |
| teslamate | Tesla data logger & analytics | |
| VictoriaMetrics | Metrics storage & alerting backend | |
| Vikunja | Tasks & tickets, recurring chores | |
| watchyourlan | LAN device discovery & monitoring | |
| workshops | Static workshop pages, synced from Git | — |
Standard tools (Helm charts, Docker images) are managed by Renovate. GitHub is the primary source of truth.
Talos nodes run Cilium (VXLAN tunnel, kube-proxy kept), which also enforces
the NetworkPolicies (docs/runbooks/cilium.md,
docs/runbooks/network-policies-rollout.md). Hubble shows every flow at
hubble.cluster.f4mily.net (Authentik,
admins only). Ingress is handled by the NGINX Ingress Controller.
SSL certificates are automated via cert-manager (Let's Encrypt).
Storage is matched to each workload's own replication model — not a one-size-fits-all default.
- Databases — node-local
local-path(NOT iSCSI): CloudNativePG (PostgreSQL) clusters run on per-nodelocal-pathstorage. CNPG replicates at the database layer (3 instances + continuous S3/barman backups), so node-local disks are both faster and keep the shared-NAS single point of failure out of the database path. This is the CNPG-recommended pattern; the previous setup ran every DB on one TrueNAS iSCSI target, which repeatedly cascaded (a single iSCSI blip → WAL corruption → cluster-wide CNPG outage). Provisioner:infrastructure/base/storage/local-path-provisioner/; classlocal-path(non-default). Backing disk: each node'ssdb1, mounted by Talos asExistingVolumeConfiglocal-storageat/var/mnt/local-storage(Omni config patch per node). - App RWO volumes (iSCSI): Application config/data volumes that have no
app-level replication use Democratic CSI on TrueNAS (
truenas-iscsi, the default class), backed up via Velero. (Such volumes are better served by replicated storage — Longhorn — than node-pinnedlocal-path; a future improvement.) - Mass Storage (NFS): Large media files (Photos, Videos, Books) and bulk document storage.
Migrating a CNPG cluster's storage — a storageClass change applies to
new instances only. Roll existing instances one at a time
(kubectl -n cnpg-system delete pvc <inst> --wait=false && kubectl -n cnpg-system delete pod <inst>);
CNPG re-bootstraps each via pg_basebackup. Wait for N/N healthy between
steps; do the primary last (brief failover).
Flux reconciles the cluster state against the GitHub repository. Changes are
applied via PRs to the main branch.
homelab-gitops/
├── clusters/ # Flux entry points
│ └── main/ # Production cluster config
├── infrastructure/ # Cluster-wide components
│ ├── base/ # Shared sources
│ │ ├── storage/ # local-path (CNPG) + iSCSI (democratic-csi) + NFS PVs
│ │ ├── database/ # CloudNativePG operator
│ │ └── ...
│ └── overlays/main/ # Cluster patches & secrets
├── apps/ # Business applications
│ ├── base/ # Generic HelmReleases & manifests
│ └── overlays/main/ # Environment-specific overrides
├── docs/ # Architecture, runbooks, migrations
└── scripts/ # Maintenance and CI helpers
# Dev shell with just + stack tooling (kubectl, flux, kustomize, sops, ...)
nix develop
# List available tasks
justjust validate # lint + kustomize build + kubeconform + helm templateRun this before every push — it mirrors the PR Validation CI check.
Secrets are encrypted in-repo with SOPS and an age key; Flux decrypts them in-cluster. Never commit plaintext secrets.
export SOPS_AGE_KEY_FILE=~/.config/sops/age/keys.txt
sops path/to/secret.sops.yaml # edit an encrypted file
sops --encrypt --in-place secret.yaml # encrypt a new secretThe cluster is bootstrapped from the sibling
homelab-infrastructure repository via OpenTofu
(see homelab-infrastructure/talos/). The Terraform module flux.tf performs
the Flux bootstrap and seeds the SOPS age secret. After Tofu apply, this repo is
the only thing Flux ever needs.
cd ../homelab-infrastructure
nix develop .#talos
cd talos
tofu init && tofu apply # Creates VMs, applies Talos config, bootstraps Flux
kubectl get nodes # 3 control planes
flux get kustomizations -A # All greennix develop # homelab-gitops dev-shell
just validate # lint + kustomize + kubeconform + helm template
git commit -am "feat: …" && git push
flux reconcile kustomization apps --with-source # optional, otherwise 1h intervalFull runbook: docs/disaster-recovery/README.md.
CNPG S3 restore: docs/disaster-recovery/cnpg-s3-dr.md.
Short version: the central PostgreSQL cluster is continuously backed up to S3
(Garage) via Barman. The disaster-recovery overlay rehydrates the cluster from
S3 on a fresh deploy.
- GitHub is leading: Always push to GitHub. Forgejo is a local mirror.
- Surgical changes: Use targeted Kustomize patches instead of duplicating base manifests.
- Persistence strategy: Match storage to each workload's replication model (see above).
- Security: Secrets are encrypted with SOPS (age). Never commit plaintext secrets.
- Automated updates: Let Renovate handle version bumps; manual overrides only when necessary.
docs/rulebook.md— distilled build rules (avoid the mistakes we already made)docs/cluster-access.md— get a kubeconfigdocs/runbooks/cilium.md— CNI operations, Hubble, emergency reinstalldocs/applications.md— enable/disable apps & hostnamesdocs/disaster-recovery/README.md— recovery runbook