Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/charlie-haley/home-infra

A monorepo for managing my home infrastructure using GitOps.
https://github.com/charlie-haley/home-infra

flux gitops k8s k8s-at-home kubernetes oci talos

Last synced: 3 months ago
JSON representation

A monorepo for managing my home infrastructure using GitOps.

Awesome Lists containing this project

README

        

# 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](https://www.talos.dev/) and managed using [Flux](https://fluxcd.io/). 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](https://discord.gg/k8s-at-home) 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](https://github.com/topics/k8s-at-home).