charlie-haley / home-infra

A monorepo for managing my home infrastructure using GitOps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

home-infra



One Repo to Rule Them All.
A monorepo for managing my home infrastructure using GitOps.

πŸ“ Folder Structure

β”œβ”€β”€ docs           # Documentation as markdown files.
β”œβ”€β”€ hack           # Scripts and other bits
β”œβ”€β”€ kubernetes     # Kubernets manifests
β”‚   β”œβ”€β”€ bootstrap    # Manifests required when bootstrapping the cluster for the first time
β”‚   β”œβ”€β”€ manifests    # Application deployment manifests
β”‚   └── templates    # Local Helm templates

☸️ Kubernetes

I run a bare metal cluster provisioned using Talos Linux and managed using Flux. The cluster is comprised of 3 worker nodes and 1 control plane node.

Hostname Node Resources
vilya-c01 Lenovo M720q Tiny 16GB RAM, i5-9500t
vilya-w01 Lenovo M720q Tiny 16GB RAM, i5-9500t
vilya-w02 Lenovo M720q Tiny 16GB RAM, i5-9500t
vilya-w03 Lenovo M720q Tiny 16GB RAM, i5-9500t

βš™οΈ GitOps

I use Flux to manage deployments to the cluster, everything that is deployed to my cluster is defined as YAML files in the kubernetes/manifests/ directory.

β”œβ”€β”€ manifests                # Manifests deployed to the cluster
β”‚   β”œβ”€β”€ cert-manager      # The namespace for all the files in the directory to be deployed to
β”‚   β”œβ”€β”€ home
β”‚   └── storage
└── gitops              # Anything and everything Flux/GitOps related
    β”œβ”€β”€ flux-system

To save on duplicate code and reduce the management overhead of adding new Flux Kustomization's, Namespaces and other boilerplate config. I template all of my manifests and deploy them up to GHCR as an OCI image. This is done through a (pretty hacky) bash script which reads the provided YAML file and actions it based on the contents.

The script is triggered by Github Actions, a webhook is then fired after the package is uploaded which tells Flux to reconcile the cluster with the state from the OCI image.

πŸ‘ Thanks

Thanks to everyone in the Kubernetes@Home Discord community Inspiration for how to deploy and my manage my cluster has been influenced heavily by everyone who's shared their clusters using the k8s-at-home GitHub tag.

About

A monorepo for managing my home infrastructure using GitOps.


Languages

Language:Go 95.8%Language:Makefile 4.2%