Giter VIP home page Giter VIP logo

home-cluster's Introduction

My home Kubernetes Talos cluster โ›ต

... managed with Flux ๐Ÿค–

๐Ÿ“–ย  Overview

This repository is my home Kubernetes cluster in a declarative state. Flux watches my cluster directory and makes the changes to my cluster based on the YAML manifests.

Feel free to open a Github issue if you have any questions.

This repository is built off the k8s-at-home/template-cluster-k3s repository.


๐ŸŽจย  Cluster components

Cluster management

  • Talos: Built using talhelper
  • fluxcd: Sync kubernetes cluster with this repository.
  • SOPS: Encrypts secrets which is safe to store - even to a public repository.

Networking

  • Cilium: For internal cluster networking, also as load balancer to expose services.
  • cert-manager: Configured to create TLS certs for all ingress services automatically using LetsEncrypt.
  • traefik: Ingress controller for services.
  • authelia: Full featured authentication server.

Storage

Host devices access

Metrics

  • Prometheus: Scraping metrics from the entire cluster
  • Grafana: Visualization for the metrics from Prometheus

๐Ÿ“‚ย  Repository structure

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

./cluster
โ”œโ”€โ”€ ./base    # entrypoint to Flux
โ”œโ”€โ”€ ./config  # cluster config, loaded before `core`
โ”œโ”€โ”€ ./crds    # custom resource definitions (CRDs), loaded before `core`
โ”œโ”€โ”€ ./core    # important infrastructure applications, loaded before `apps`
โ””โ”€โ”€ ./apps    # common applications, loaded last

๐Ÿ“กย  Network structure

Incoming http and https traffics from outside of my network are forwarded from OPNSense firewall into Traefik pod with a LoadBalancer service using MetalLB layer2 implementation. So, basically this is how the http(s) traffic flows:

Internet -> OPNSense firewall -> Traefik service -> Kubernetes pod

Traefik service is using Local externalTrafficPolicy so I can track the real IP of clients trying to access my services. For important backend services like my OPNSense and Traefik dashboards, I use ipWhiteList middleware to only allow access from my internal networks. My certificates are managed with cert-manager using LetsEncrypt as the CA.


๐Ÿ”ย  Secret and configmaps management

Secrets are encrypted using sops before being pushed into this repository. The encrypted secrets are then decrypted by sops using the private key inside the cluster. For encryption/decryption, I use age. The public key to encrypt the secret is in .sops.yaml. Secrets environment variables for the cluster are in cluster-secret-vars.yaml. The non secret variables are in cluster-vars.yaml.


๐Ÿ“Šย  Metrics and chart management

Metrics scraping for the cluster are done using Prometheus.

Dashboards included in my cluster are:

To add your own dashboard, create a configmap with the data include the json file of the dashboard and add label grafana_dashboard: "1" to the manifest. The sidecar container from this image will mount the dashboard into your grafana pod.


๐Ÿคย  Thanks

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


Todo List

  • Use redis operator

home-cluster's People

Contributors

budimanjojo avatar budimanjojo-bot[bot] 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.