# bartbrinkman/homelab-k8s architecture

> Architecture diagram of the GitHub repository bartbrinkman/homelab-k8s, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bartbrinkman/homelab-k8s
- Repository: https://github.com/bartbrinkman/homelab-k8s

## Overview

##### High-Level Components

a. Infrastructure Layer
- Kubernetes Cluster (kubeadm-based)
- Flannel Network (pod-network-cidr: 10.244.0.0/16)
- Control Plane Components

b. Core Platform Services
- Argo CD (Central GitOps Controller)
- App-of-Apps Root Application
- Ingress-NGINX Controller
- Cert-Manager
- Sealed Secrets

c. Monitoring & Observability Stack
- Kube-Prometheus Stack
- Metrics Server
- Istio with Kiali
- InfluxDB

d. Storage & Data Services
- Longhorn (Storage)
- MinIO with DirectPV
- MySQL
- PostgreSQL

e. Application Services
- Multiple web applications (BudgetZero, CyberChef, Grocy, etc.)
- Development Tools (Code-Server)
- Infrastructure Management (Portainer, Kubernetes Dashboard)

##### Connection Flows

Key relationships:
- Argo CD's control flow to all applications
- Ingress traffic flow through OAuth2-Proxy
- Storage relationships between apps and persistent volumes
- Monitoring data flow to Prometheus
- Service mesh connections through Istio

##### Specific Implementation Details

Crucial elements:
- KEDA scalers (shown for Grocy, Kubernetes Dashboard, etc.)
- Cert-Manager integration with ingress resources
- Sealed Secrets usage for sensitive data
- DirectPV integration with MinIO

##### Hierarchy Levels

1. Infrastructure Foundation (Bottom)
2. Core Services (Next Layer)
3. Platform Services (Middle Layer)
4. Applications (Top Layer)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Infrastructure
        K8S[Kubernetes Cluster]:::infra
        NET[Flannel Network<br>10.244.0.0/16]:::infra
        CP[Control Plane]:::infra
    end

    subgraph Core_Services
        ARGO[Argo CD]:::core
        AOA[App of Apps]:::core
        ING[Ingress NGINX]:::core
        CERT[Cert Manager]:::core
        SEAL[Sealed Secrets]:::core
        OAUTH[OAuth2 Proxy]:::core
    end

    subgraph Monitoring
        PROM[Prometheus Stack]:::monitoring
        METRICS[Metrics Server]:::monitoring
        ISTIO[Istio with Kiali]:::monitoring
        INFLUX[InfluxDB]:::monitoring
    end

    subgraph Storage
        LONG[Longhorn]:::storage
        MINIO[MinIO]:::storage
        MYSQL[MySQL]:::storage
        PSQL[PostgreSQL]:::storage
    end

    subgraph Applications
        BZ[BudgetZero]:::app
        CC[CyberChef]:::app
        GR[Grocy]:::app
        CS[Code Server]:::app
        PORT[Portainer]:::app
        KD[Kubernetes Dashboard]:::app
    end

    subgraph AutoScaling
        KEDA[KEDA]:::scaling
    end

    %% Infrastructure Relationships
    K8S --> NET
    K8S --> CP

    %% Core Service Relationships
    ARGO --> AOA
    AOA --> ING
    AOA --> CERT
    AOA --> SEAL
    ING --> OAUTH

    %% Monitoring Relationships
    PROM --> K8S
    METRICS --> K8S
    ISTIO --> K8S
    INFLUX --> K8S

    %% Storage Relationships
    LONG --> K8S
    MINIO --> K8S
    MYSQL --> K8S
    PSQL --> K8S

    %% Application Relationships
    OAUTH --> BZ
    OAUTH --> CC
    OAUTH --> GR
    OAUTH --> CS
    OAUTH --> PORT
    OAUTH --> KD

    %% Autoscaling Relationships
    KEDA --> GR
    KEDA --> KD
    KEDA --> PORT

    %% Component Mappings
    click AOA "https://github.com/bartbrinkman/homelab-k8s/blob/master/app-of-apps/Chart.yaml"
    click ING "https://github.com/bartbrinkman/homelab-k8s/blob/master/ingress-nginx/templates/synology.yaml"
    click CERT "https://github.com/bartbrinkman/homelab-k8s/blob/master/cert-manager/templates/cluster-issuer.yaml"
    click SEAL "https://github.com/bartbrinkman/homelab-k8s/blob/master/sealed-secrets/Chart.yaml"
    click PROM "https://github.com/bartbrinkman/homelab-k8s/blob/master/kube-prometheus-stack/Chart.yaml"
    click METRICS "https://github.com/bartbrinkman/homelab-k8s/blob/master/metrics-server/Chart.yaml"
    click ISTIO "https://github.com/bartbrinkman/homelab-k8s/blob/master/istio/templates/kiali-cr.yaml"
    click INFLUX "https://github.com/bartbrinkman/homelab-k8s/blob/master/influxdb/templates/secret.yaml"
    click LONG "https://github.com/bartbrinkman/homelab-k8s/blob/master/longhorn/Chart.yaml"
    click MINIO "https://github.com/bartbrinkman/homelab-k8s/blob/master/minio/templates/directpv.yaml"
    click MYSQL "https://github.com/bartbrinkman/homelab-k8s/blob/master/mysql/templates/secret.yaml"
    click PSQL "https://github.com/bartbrinkman/homelab-k8s/blob/master/postgres/templates/secret.yaml"
    click OAUTH "https://github.com/bartbrinkman/homelab-k8s/blob/master/oauth2-proxy/templates/sealed-secret.yaml"
    click KD "https://github.com/bartbrinkman/homelab-k8s/blob/master/kubernetes-dashboard/templates/scaled-object.yaml"
    click PORT "https://github.com/bartbrinkman/homelab-k8s/blob/master/portainer/templates/scaled-object.yaml"
    click CS "https://github.com/bartbrinkman/homelab-k8s/blob/master/code-server/templates/deployment.yaml"
    click BZ "https://github.com/bartbrinkman/homelab-k8s/blob/master/budgetzero/templates/deployment.yaml"
    click CC "https://github.com/bartbrinkman/homelab-k8s/blob/master/cyberchef/templates/deployment.yaml"
    click GR "https://github.com/bartbrinkman/homelab-k8s/blob/master/grocy/templates/deployment.yaml"
    click KEDA "https://github.com/bartbrinkman/homelab-k8s/blob/master/keda/Chart.yaml"

    classDef infra fill:#1e88e5,stroke:#000,stroke-width:2px
    classDef core fill:#43a047,stroke:#000,stroke-width:2px
    classDef monitoring fill:#ff9800,stroke:#000,stroke-width:2px
    classDef storage fill:#9c27b0,stroke:#000,stroke-width:2px
    classDef app fill:#3f51b5,stroke:#000,stroke-width:2px
    classDef scaling fill:#f44336,stroke:#000,stroke-width:2px
```
