Coder Social home page Coder Social logo

nickazuredevops / kochhaus-home Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haraldkoch/kochhaus-home

0.0 0.0 0.0 6.1 MB

Experimental homelab configuration for running things on kubernetes

License: MIT License

Shell 79.62% Jinja 20.38%

kochhaus-home's Introduction

kochhaus-home - Home Cloud via Flux v2 | GitOps Toolkit

GitOps state for my cluster using flux v2

k8s GitHub last commit

K3S in a 7-node cluster running Arch Linux.

  • Four Lenovo M900 Tinys
  • Three VMs on my older homelab servers.

There's a full server list below.

Off-cluster support

  • registry - I have a separate host running Kubernetes and an instance of the Harbor container registry, configured as a pull-through cache.
  • named - primary home DNS running on a pair of (redundant) Raspberry Pi 3s.
  • blocky - lightweight ad-blocking DNS resolver - this has replaced an older Pi-Hole. Thinking of checking out NextDNS.

Cluster components

  • Flux 2 - GitOps manager that configures the cluster entirely from this GitHub repository.
  • SOPS - Encrypts secrets which is safe to store - even to a public repository.

Networking

  • calico - container networking with IPv6 support and policy enforcement.
  • cert-manager - Configured to create TLS certs for all ingress services automatically using LetsEncrypt.
  • external-dns - monitors service and ingress resources, and automatically generates DNS updates for them. This lets me maintain DNS mappings and LetsEncrypt certificates without a cloudflare account or domain.
  • metallb - Kubernetes Load Balancer that runs on Kubernetes.
  • nginx ingress - Ingress controller. I used to use Traefik, but it it much more challenging to configure correctly.

Storage

  • democratic-csi - creates Persistent Volumes on a ZFS server as separate datasets, and exports them via NFS or iSCSI to the Kubernetes cluter.
  • nfs-subdir-external-provisioner - creates Persistent Volumes on a pre-existing NFS mount.
  • rook-ceph - on-cluster (hyperconverged) storage - eventually this will all be on SSDs attached to the cluster nodes for low power usage.

infrastructure

  • descheduler - analyzes the cluster looking for overloaded or under-utilized nodes, as well as pods violating affinity rules, and evicts them so that they will be rescheduled "correctly".
  • kube-fledged - caches critical images locally on each node for reliability during an Internet outage.
  • kured - The Kubernetes Reboot Daemon.
  • prometheus - metrics, monitoring, and alerting.
  • reloader - reloads pods when a configMap and/or Secret changes - something that Flux 2 does not manage itself.
  • system-upgrade-controller - Automatically upgrade the K3S kubernetes instance.
  • cloudnative-pg - build and manage a postgresql cluster with HA and backups from a custom resource.
  • ext-postgres-operator - create databases and users in an existing postgres cluster.
  • authentik - integrated authentication and user management.
  • volsync - data backup and restore. In a GitOps environment I don't need to backup the Kubernetes resources the way Velero and K10 do, and those tools are hard to manage. VolSync backs up my data.
  • And more!

Home Infrastructure

Applications

  • outline - full featured documentation platform.
  • tautulli - Plex usage monitoring application.
  • onedrive - syncs my OneDrive folder from Microsoft, as a local backup.
  • syncthing - simple, peer-to-peer file synch app replacing Dropbox or NextCloud.
  • actions-runner - Run GitHub Actions at home!
  • tekton - simple CI/CD tooling.
  • nextcloud - Finally - moving applications from Linode to my homelab.

Yes, this is a lot of infrastructure and heavy lifting - the point is to experiment with Kubernetes and GitOps in a safe space.

dexhorthy

I have two longer-term goals:

  1. migrate many of the apps that I currently run on Linode to my HomeLab.
  2. Build a small Raspberry Pi cluster at home to run a lot of infrastructure, with the intent of being able to run off a small UPS during power outages.

Repository structure

The Git repository contains the following directories under cluster and are ordered below by how Flux will apply them.

๐Ÿ“ cluster      # k8s cluster defined as code
โ”œโ”€๐Ÿ“ flux       # flux, gitops operator, loaded before everything
โ”œโ”€๐Ÿ“ crds       # custom resources, loaded before ๐Ÿ“ core and ๐Ÿ“ apps
โ”œโ”€๐Ÿ“ charts     # helm repos, loaded before ๐Ÿ“ core and ๐Ÿ“ apps
โ”œโ”€๐Ÿ“ config     # cluster config, loaded before ๐Ÿ“ core and ๐Ÿ“ apps
โ”œโ”€๐Ÿ“ core       # crucial apps, namespaced dir tree, loaded before ๐Ÿ“ apps
โ””โ”€๐Ÿ“ apps       # regular apps, namespaced dir tree, loaded last

Automation


๐Ÿ’ป Nodes

Node Hostname CPU RAM Storage Function Operating System
Lenovo M900q tiny k3st 4 Intel i5-6500T 8GB 128GB SSD control-plane Arch Linux
libvirtd VM k3sj 4 AMD Ryzen 5 1600T 4GB 128GB HDD control-plane Arch Linux
libvirtd VM k3sm 2 AMD Athlon 3000G 4GB 128GB HDD control-plane Arch Linux
Lenovo M910q tiny k3s0 4 Intel i5-6500T 16GB 512GB NVMe worker, ceph storage Arch Linux
libvirtd VM k3s1 6 AMD Ryzen 5 1600T 16GB 256GB HDD worker, ceph storage Arch Linux
Lenovo M900q tiny k3s2 4 Intel i5-6500T 16GB 512GB SSD worker, ceph storage Arch Linux
Lenovo M910q tiny k3s3 4 Intel i5-6500T 16GB 512GB NVMe worker, ceph storage Arch Linux

Community

This cluster in inspired by the work of others shared at awesome-home-kubernetes.

kochhaus-home's People

Contributors

haraldkoch avatar renovate[bot] avatar renovate-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.