marcizhu / microk8s-nas

Kubernetes manifests for my DIY Home MicroK8s NAS server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MicroK8s NAS

microk8s-nas - Home Cloud via ArgoCD | GitOps Toolkit

GitOps state for my cluster using ArgoCD

MicroK8s Last commit

Lightweight single-node MicroK8s cluster for my home NAS running Ubuntu Server.

πŸ’»  Nodes

Device CPU OS Disk Data Disk RAM OS Purpose
Lenovo ThinkCentre M700 Tiny Intel Core i5-6400T 1x 256 GB SSD 3x 2 Tb HDD 16 GB Ubuntu Server NAS/NFS/k8s

Total CPU: 8 threads
Total RAM: 16 GB

Off-cluster support

  • RAID: All three disks are in a RAID 5 configuration for redundancy.
  • NFS Server: The NFS server runs on the host machine outside Kubernetes and allows connecting to the RAID array from outside the node

🎨  Cluster components

Networking

  • Blocky: A DNS proxy and ad-blocker for the local network with a custom domain
  • Calico: Container networking with IPv6 support and policy enforcement
  • MetalLB: A network load-balancer implementation for Kubernetes using standard routing protocols
  • NGINX Ingress Controller: Ingress-NGINX Controller for Kubernetes

Infrastructure

  • ArgoCD: A declarative, GitOps continuous delivery tool for Kubernetes
  • Renovate: Universal dependency update tool to keep manifests up-to-date
  • Prometheus: A tool to scrape and store time-series metrics from other services
  • Grafana: An open-source dashboard to monitor Kubernetes, storage and system metrics

Applications

  • Transmission: A fast, easy and free torrent client for macOS, Windows and Linux
  • Plex: A library for all your videos, movies and series, allowing to watch them on you phone, smart TV, computer, etc.
  • Gickup: A simple tool to backup all my repositories locally to my NAS

🌐  Network configuration

The service Blocky deployed in-cluster has three purposes:

  1. Acts as a local DNS cache, speeding up DNS queries at home
  2. DNS-level ad-filtering, similar to Pi-Hole. Blocks ads, adult content, etc
  3. Custom domain: resolves any subdomain *.nas-local.io to the cluster's IP

By configuring the cluster as the primary DNS in the router, any device connected by DHCP will be able to access any service deployed through the subdomains *.nas-local.io. NGINX Ingress will route the requests depending on the Host: HTTP header.

Thanks to MetalLB, any non-HTTP service can be deployed on its own IP address, so that it doesn't interfere with other services.

πŸ”§  Maintenance

Maintenance of the cluster is fairly minimal thanks to Renovate and ArgoCD: an hourly cronjob runs renovate bot, which will create PRs in this repo to update docker images in the cluster. Then, ArgoCD will apply any PR merged into master automatically, keeping everything up-to-date with minimal interaction.

πŸ“‚  Repository structure

The git repository contains the following directories. The main folder is apps, which contains the Kubernetes manifests for all applications running in the cluster. The folder bootstrap contains some CRDs needed to bootstrap the cluster, but they are not needed afterwards.

πŸ“ (root)
β”œβ”€πŸ“ apps       # cluster apps, usually one file per application
β”œβ”€πŸ“ bootstrap  # CRDs and other resources for setting up the cluster

About

Kubernetes manifests for my DIY Home MicroK8s NAS server