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.
My Kubernetes cluster is dualstack (IPv6 primary) deploy with K3s. 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.
Thanks to onedr0p/cluster-template if you want to try and follow along with some of the practices I use here.
- actions-runner-controller: Self-hosted Github runners.
- cert-manager: Creates SSL certificates for services in my cluster.
- calico: Internal Kubernetes container networking interface.
- cloudflared: Enables Cloudflare secure access to certain ingresses.
- external-dns: Automatically syncs ingress DNS records to a DNS provider.
- istio: Kubernetes gatewayapi, mTLS and service mesh.
- Metallb: LB service IPAM and controller (speakerless mode). Service advertisment is done via BGP using Calico Bird.
- sops: Managed secrets for Kubernetes and Terraform which are commited to Git.
- spegel: Stateless cluster local OCI registry mirror.
- volsync: Backup and recovery of persistent volume claims.
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.
This Git repository contains the following directories under Kubernetes.
📁 kubernetes
├── 📁 neo # neo cluster
│ ├── 📁 apps # applications
│ ├── 📁 bootstrap # bootstrap procedures
│ ├── 📁 flux # core flux configuration
│ └── 📁 templating # re-useable components
├── 📁 shared # shared cluster resources
└── 📁 ... # other clusters
Device | Num | OS Disk Size | Data Disk Size | Ram | OS | Function |
---|---|---|---|---|---|---|
Thinkcenter | 3 | 1TB SSD | 1TB | 64GB | Ubuntu | Kubernetes |
Beelink EQ12 | 1 | 1TB SSD | 1TB | 16GB | Ubuntu | Kubernetes |
JONSB N4 (N100 MB) | 1 | 1TB SSD | 6x4TB ZFS Z1 | 32GB | Ubuntu | NFS + Backup Server |
Thanks to all the people who donate their time to the Home Operations Discord community.