# anthonyenr1quez/k3s-gitops architecture

> Architecture diagram of the GitHub repository anthonyenr1quez/k3s-gitops, 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/anthonyenr1quez/k3s-gitops
- Repository: https://github.com/anthonyenr1quez/k3s-gitops

## Overview

##### Main Components

a. Infrastructure Layer:
- Three physical nodes (gulsun, loreto, mina) with their specifications
- Network infrastructure (including MetalLB for load balancing)
- Storage systems (NFS, local-path, democratic-csi)

b. Platform Layer:
- K3s Kubernetes distribution
- Flux GitOps engine
- Core services (cert-manager, gateway-api, envoy-gateway)

c. Application Layer (grouped by namespace):
- Download stack (bazarr, prowlarr, qbittorrent, radarr, sonarr, requestrr)
- Media stack (calibre, plex)
- Home automation (home-assistant, mealie)
- Storage services (minio, nfs-server, volsync)
- Networking services (blocky, omada-controller)
- Observability (botkube)

**[Physical Infrastructure]**
- ↓
**[Kubernetes Layer]**
- ↓
**[Platform Services]**
- ↓
**[Application Services]**

##### Key Relationships to Highlight

- Flux GitOps workflow:
GitHub → Flux → Kubernetes Resources
- Storage relationships:
NFS Server → PersistentVolumes → Applications
- Network flow:
External Traffic → Envoy Gateway → Services
- Backup paths:
Applications → VolSync → MinIO/External Storage

##### Specific Implementation Details

a. Create three main sections:

**[Infrastructure]**
- Show 3 physical nodes
- MetalLB load balancer
- Network storage (11TB NFS)

**[Platform Core]**
- Flux controllers
- Cert-manager
- Gateway API components
- Storage provisioners

**[Applications]**
**Group by namespace:**
- download/
- media/
- home/
- networking/
- storage/
- observability/

b. Special notations for:
- SOPS encrypted secrets
- Persistent storage locations
- External access points
- Backup paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef infrastructure fill:#b3d1ff,stroke:#333
    classDef platform fill:#90EE90,stroke:#333
    classDef application fill:#FFB347,stroke:#333
    classDef storage fill:#DDA0DD,stroke:#333
    classDef network fill:#D3D3D3,stroke:#333
    classDef security fill:#FF6B6B,stroke:#333

    %% Infrastructure Layer
    subgraph Physical["Physical Infrastructure"]
        Nodes["3 Physical Nodes<br/>(gulsun, loreto, mina)"]:::infrastructure
        Storage["11TB NFS Storage"]:::storage
    end

    %% Platform Layer
    subgraph Platform["Platform Services"]
        Flux["Flux GitOps"]:::platform
        CertManager["Cert Manager"]:::security
        Gateway["Gateway API"]:::network
        Envoy["Envoy Gateway"]:::network
        MetalLB["MetalLB"]:::network
    end

    %% Storage Services
    subgraph StorageServices["Storage Services"]
        LocalPath["Local Path<br/>Provisioner"]:::storage
        DemocraticCSI["Democratic CSI"]:::storage
        NFSServer["NFS Server"]:::storage
        MinIO["MinIO"]:::storage
        VolSync["VolSync"]:::storage
    end

    %% Application Layer
    subgraph Apps["Applications"]
        subgraph Download["Download Stack"]
            Bazarr["Bazarr"]:::application
            Prowlarr["Prowlarr"]:::application
            Qbittorrent["Qbittorrent"]:::application
            Radarr["Radarr"]:::application
            Sonarr["Sonarr"]:::application
            Requestrr["Requestrr"]:::application
        end

        subgraph Media["Media Stack"]
            Calibre["Calibre"]:::application
            Plex["Plex"]:::application
        end

        subgraph Home["Home Automation"]
            HomeAssistant["Home Assistant"]:::application
            Mealie["Mealie"]:::application
        end

        subgraph Network["Network Services"]
            Blocky["Blocky"]:::network
            Omada["Omada Controller"]:::network
        end

        subgraph Observability["Observability"]
            Botkube["Botkube"]:::application
        end

        subgraph System["System Components"]
            MetricsServer["Metrics Server"]:::platform
            SOPSSecrets["SOPS Secrets<br/>Operator"]:::security
            UpgradeController["System Upgrade<br/>Controller"]:::platform
        end
    end

    %% Relationships
    Nodes --> Platform
    Platform --> Apps
    StorageServices --> Apps
    
    %% Click Events
    click MetalLB "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/networking/metallb"
    click LocalPath "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/storage/local-path-provisioner"
    click DemocraticCSI "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/storage/democratic-csi"
    click NFSServer "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/storage/nfs-server"
    click MinIO "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/storage/minio"
    click VolSync "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/storage/volsync"
    click Flux "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/flux-system"
    click CertManager "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/networking/cert-manager"
    click Gateway "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/networking/gateway-api"
    click Envoy "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/networking/envoy-gateway"
    click Download "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/download"
    click Bazarr "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/download/bazarr"
    click Prowlarr "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/download/prowlarr"
    click Qbittorrent "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/download/qbittorrent"
    click Radarr "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/download/radarr"
    click Sonarr "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/download/sonarr"
    click Requestrr "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/download/requestrr"
    click Media "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/media"
    click Calibre "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/media/calibre"
    click Plex "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/media/plex"
    click HomeAssistant "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/home/home-assistant"
    click Mealie "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/home/mealie"
    click Blocky "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/networking/blocky"
    click Omada "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/networking/omada-controller"
    click Botkube "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/observability/botkube"
    click MetricsServer "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/kube-system/metrics-server"
    click SOPSSecrets "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/kube-system/sops-secrets-operator"
    click UpgradeController "https://github.com/AnthonyEnr1quez/k3s-gitops/tree/main/kubernetes/home-lab/apps/system-upgrade/system-upgrade-controller"

    %% Legend
    subgraph Legend
        L1["Infrastructure"]:::infrastructure
        L2["Platform"]:::platform
        L3["Application"]:::application
        L4["Storage"]:::storage
        L5["Network"]:::network
        L6["Security"]:::security
    end
```
