# qjoly/gitops architecture

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

- Interactive diagram: https://gitdiagram.com/qjoly/gitops
- Repository: https://github.com/qjoly/gitops

## Overview

##### Main System Components

a) Cluster Management Layer
- Omni (self-hosted) at the top level
- Connections to multiple Kubernetes clusters (Cortado, Arabica, Lungo, Home)
- Talos OS as the underlying system for nodes

b) Core Infrastructure Layer (Per Cluster)
- CNI: Cilium (with load balancing in ARP mode)
- Storage: Longhorn/ZFS + Local-Path-Provisioner
- Network: Cloudflare Tunnels (specifically for home cluster)

c) Platform Services Layer
- GitOps: ArgoCD
- Ingress: Nginx Ingress Controller/Istio
- Certificate Management: Cert-Manager
- Secret Management:
- Vault (central store)
- External Secrets Operator
- ~~Reflector~~ (noted as removed)

**┌─ Omni Control Plane ─────────────────────┐**

- ┌─ Cluster Management ──┐              │
- SSO Integration    │              │
- Node Management    │              │
- ┘              │
- ┬───────────────────────────┘
- ▼
**┌─────────────────────────────────────────┐**
- Kubernetes Clusters                      │
- ┬─────────┬─────────┬──────────┤
- Cortado │ Arabica │ Lungo   │ Home     │
- (OVH)   │ (OVH)   │ (VM)    │ (Local)  │
- ┴─────────┴─────────┴──────────┘

##### Component Relationships

Key relationships:
- ArgoCD → Git Repository (GitOps workflow)
- External DNS → Cloudflare
- Cert-Manager → Let's Encrypt
- Applications → Persistent Storage
- Ingress → External Access

##### Metadata Section

- Kubernetes versions
- Talos versions
- Cluster ages and uptimes
- Resource usage metrics

Remember to:
- Keep components grouped by function
- Clear data flow directions
- High-availability configurations
- Backup paths and storage relationships
- Monitoring components (Prometheus, Grafana)

This structure reflects the project's sophisticated multi-cluster architecture while maintaining clarity about how components interact across the system.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Cluster Management Layer
    Omni(("Omni Control Plane")):::control
    
    subgraph Clusters["Kubernetes Clusters"]
        Cortado["Cortado (OVH)"]:::cluster
        Arabica["Arabica (OVH)"]:::cluster
        Lungo["Lungo (VM)"]:::cluster
        Home["Home (Local)"]:::cluster

        subgraph CortadoApps["Cortado Apps"]
            C_App1["App 1"]
            C_App2["App 2"]
        end

        subgraph ArabicaApps["Arabica Apps"]
            A_App1["App 1"]
            A_App2["App 2"]
        end

        subgraph LungoApps["Lungo Apps"]
            L_App1["App 1"]
            L_App2["App 2"]
        end

        subgraph HomeApps["Home Apps"]
            H_App1["App 1"]
            H_App2["App 2"]
        end
    end

    %% Core Infrastructure Layer
    subgraph Infrastructure["Core Infrastructure"]
        CNI["Cilium CNI"]:::network
        Storage["Storage Layer"]:::storage
        subgraph StorageTypes["Storage Solutions"]
            Longhorn["Longhorn"]:::storage
            ZFS["ZFS"]:::storage
            LocalPath["Local-Path-Provisioner"]:::storage
        end
        CloudflareTunnel["Cloudflare Tunnels"]:::network
    end

    %% Platform Services Layer
    subgraph Platform["Platform Services"]
        ArgoCD["ArgoCD"]:::gitops
        Ingress["Nginx Ingress"]:::network
        CertManager["Cert-Manager"]:::security
        subgraph Secrets["Secret Management"]
            Vault["Vault"]:::security
            ExtSecrets["External Secrets"]:::security
        end
        subgraph Monitoring["Monitoring Stack"]
            Prometheus["Prometheus"]:::monitoring
            Grafana["Grafana"]:::monitoring
            Loki["Loki Stack"]:::monitoring
        end
        ExtDNS["External DNS"]:::network
        Volsync["Volsync Backup"]:::backup
    end

    %% Relationships
    Omni --> Cortado
    Omni --> Arabica
    Omni --> Lungo
    Omni --> Home
    
    Cortado --> CortadoApps
    Arabica --> ArabicaApps
    Lungo --> LungoApps
    Home --> HomeApps
    
    ArgoCD --> GitRepo["Git Repository"]:::external
    ExtDNS --> Cloudflare["Cloudflare"]:::external
    CertManager --> LetsEncrypt["Let's Encrypt"]:::external
    CloudflareTunnel --> Cloudflare
    
    %% Storage Relationships
    Storage --> StorageTypes
    Volsync --> Minio["MinIO"]:::backup

    %% Click Events
    click Cortado "https://github.com/qjoly/gitops/tree/main//cortado/"
    click Arabica "https://github.com/qjoly/gitops/tree/main//arabica/"
    click Lungo "https://github.com/qjoly/gitops/tree/main//lungo/"
    click Home "https://github.com/qjoly/gitops/tree/main//home/"
    click CNI "https://github.com/qjoly/gitops/blob/main//common/cilium/install-cilium.yaml"
    click LocalPath "https://github.com/qjoly/gitops/tree/main//arabica/system/storage/local-path-provisioner/"
    click ZFS "https://github.com/qjoly/gitops/blob/main//arabica/patches/zfs.yml"
    click CloudflareTunnel "https://github.com/qjoly/gitops/tree/main//cortado/system/cloudflare/"
    click ArgoCD "https://github.com/qjoly/gitops/tree/main//common/argocd/"
    click Ingress "https://github.com/qjoly/gitops/blob/main//common/nginx-controller.yaml"
    click CertManager "https://github.com/qjoly/gitops/blob/main//common/cert-manager.yaml"
    click Vault "https://github.com/qjoly/gitops/blob/main//common/vault.yaml"
    click ExtSecrets "https://github.com/qjoly/gitops/tree/main//arabica/system/external-secret/"
    click Prometheus "https://github.com/qjoly/gitops/blob/main//arabica/system/monitoring/prometheus.yaml"
    click Grafana "https://github.com/qjoly/gitops/blob/main//arabica/system/monitoring/grafana.yaml"
    click Loki "https://github.com/qjoly/gitops/blob/main//arabica/system/monitoring/loki-stack.yaml"
    click ExtDNS "https://github.com/qjoly/gitops/tree/main//arabica/system/external-dns/"
    click Volsync "https://github.com/qjoly/gitops/blob/main//arabica/system/storage/volsync.yaml"

    %% Styling
    classDef cluster fill:#f9f,stroke:#333,stroke-width:2px
    classDef control fill:#f96,stroke:#333,stroke-width:2px
    classDef network fill:#9cf,stroke:#333,stroke-width:1px
    classDef storage fill:#9f9,stroke:#333,stroke-width:1px
    classDef security fill:#ff9,stroke:#333,stroke-width:1px
    classDef monitoring fill:#c9f,stroke:#333,stroke-width:1px
    classDef backup fill:#fc9,stroke:#333,stroke-width:1px
    classDef external fill:#ddd,stroke:#333,stroke-width:1px
    classDef gitops fill:#9fc,stroke:#333,stroke-width:1px
```
