/home-cluster

My home Kubernetes (k3s) cluster managed by GitOps (Flux2)

Primary LanguageShellApache License 2.0Apache-2.0

My home Kubernetes cluster ⛵

... managed by Flux and serviced with RenovateBot 🤖




Discord k3s pre-commit renovate


📖  Overview

This repository is my homelab Kubernetes cluster in a declarative state. Flux2 watches my cluster folder and makes the changes to my cluster based on the YAML manifests.

Feel free to open a Github issue or join the k8s@home Discord if you have any questions.

💻  Cluster setup

See my project over at home-operations for how I provisioned my nodes and other work that supports running this cluster.

🤖  Automate all the things!

  • Kured to apply OS patches to my nodes.
  • System Controller Upgrader to apply updates to Kubernetes.
  • Renovate keeps my application charts and container images up-to-date by scanning my repo and opening pull requests when it notices updates.
  • Actions Runner Controller operates a self-hosted Github runner in my cluster which I use to generate and apply Sealed Secrets to my cluster. Generate your Git-Crypt key and save it in the Github secrets as GIT_CRYPT_KEY

🌐  Networking

In my cluster I run coredns, etcd, and external-dns. External-DNS populates CoreDNS with all my ingress records and stores it in etcd. When I'm browsing any of the webapps while on my home network, the traffic is being routed internally and never makes a round trip. The way I set this up is in my router. When a DNS request is made for my domain or any of my subdomains it uses coredns as the DNS server, otherwise it uses whatever upstream DNS I provided.

🔧  Tools

Below are some of the tools I find useful for working with my cluster

Tool Purpose
direnv Set KUBECONFIG environment variable based on present working directory
git-crypt Encrypt certain files in my repository that can only be decrypted with a key on my computers
go-task Replacement for make and makefiles, who honestly likes that?
pre-commit Ensure the YAML and shell script in my repo are consistent
kubetail Tail logs in Kubernetes, also check out stern (which fork? good luck)

🤝  Thanks

A lot of inspiration for my cluster came from the people that have shared their clusters over at awesome-home-kubernetes