# clarknova99/talos-cluster architecture

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

- Interactive diagram: https://gitdiagram.com/clarknova99/talos-cluster
- Repository: https://github.com/clarknova99/talos-cluster

## Overview

##### High-Level Architecture Components

a) Infrastructure Layer
- Hardware nodes (3x Beelink EQ13, 2x Intel NUC, Synology NAS)
- Network components (Firewalla Gold, Zyxel Switch)
- Power (APC UPS)

b) Platform Layer
- Talos OS (Operating System layer)
- Kubernetes Control Plane (on Beelink nodes)
- Worker Nodes (on NUC systems)

c) Core Services Layer
- Networking: Cilium (CNI and Load Balancer)
- Security: cert-manager, SOPS with age
- DNS/Ingress: external-dns, ingress-nginx
- Storage: OpenEBS, Minio, Rook-Ceph
- Monitoring: Prometheus, Grafana, Fluent-bit

d) Application Layer (Group by namespace)
- Database systems (CloudNative PG, InfluxDB)
- Media services (Plex, Bazarr, etc.)
- Network services (Cloudflared, Echo-server)
- Observability stack
- Default applications

##### Connection Flow Representation

- External access paths (bold lines)

##### Specific Implementation Details

Create distinct sections showing:

a) External Access Flow
**Internet -> Cloudflare -> Cloudflared -> Ingress-NGINX -> Services**

b) Storage Architecture
**Applications -> PVC -> OpenEBS/Rook-Ceph -> Physical Storage**

c) Monitoring Flow
**Metrics -> Prometheus -> Grafana**
**Logs -> Fluent-bit -> Loki -> Grafana**

##### Key Elements to Highlight

- GitOps workflow with Flux
- Backup paths and storage locations
- Security boundaries and certificate management
- Network policy enforcement points
- High availability configurations
- Persistent storage paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% Infrastructure Layer
    subgraph Infrastructure
        BL1[Beelink EQ13 1]:::hardware
        BL2[Beelink EQ13 2]:::hardware
        BL3[Beelink EQ13 3]:::hardware
        NUC1[Intel NUC 1]:::hardware
        NUC2[Intel NUC 2]:::hardware
        NAS[Synology NAS]:::hardware
        FW[Firewalla Gold]:::network
        SW[Zyxel Switch]:::network
        UPS[APC UPS]:::power
    end

    %% Platform Layer
    subgraph Platform
        TALOS[Talos OS]:::os
        click TALOS "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/bootstrap/talos/"
        K8S[Kubernetes Control Plane]:::k8s
        FLUX[Flux]:::platform
        click FLUX "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/flux/"
    end

    %% Core Services Layer
    subgraph CoreServices
        %% Networking
        CILIUM[Cilium CNI]:::network
        click CILIUM "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/kube-system/cilium/"
        
        %% Security
        CERT[cert-manager]:::security
        click CERT "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/cert-manager/cert-manager/"
        
        %% DNS/Ingress
        INGRESS[ingress-nginx]:::network
        click INGRESS "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/network/ingress-nginx/"
        EXTDNS[external-dns]:::network
        click EXTDNS "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/network/external-dns/"
        K8SGW[k8s-gateway]:::network
        click K8SGW "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/network/k8s-gateway/"
        
        %% Storage
        OPENEBS[OpenEBS]:::storage
        click OPENEBS "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/openebs-system/openebs/"
        ROOK[Rook-Ceph]:::storage
        click ROOK "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/rook-ceph/rook-ceph/"
    end

    %% Monitoring Stack
    subgraph Monitoring
        PROM[Prometheus]:::monitoring
        click PROM "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/observability/kube-prometheus-stack/"
        GRAFANA[Grafana]:::monitoring
        click GRAFANA "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/observability/grafana/"
        FLUENT[Fluent-bit]:::monitoring
        click FLUENT "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/observability/fluent-bit/"
        LOKI[Loki]:::monitoring
        click LOKI "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/observability/loki/"
    end

    %% Application Layer
    subgraph Applications
        %% Databases
        CNPG[CloudNative PG]:::database
        click CNPG "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/database/cloudnative-pg/"
        INFLUX[InfluxDB]:::database
        click INFLUX "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/database/influxdb/"
        
        %% Media Services
        PLEX[Plex]:::media
        click PLEX "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/media/plex/"
        BAZARR[Bazarr]:::media
        click BAZARR "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/media/bazarr/"
        SONARR[Sonarr]:::media
        click SONARR "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/media/sonarr/"
        RADARR[Radarr]:::media
        click RADARR "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/media/radarr/"
        
        %% Network Services
        CFLARE[Cloudflared]:::network
        click CFLARE "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/network/cloudflared/"
        ECHO[Echo-server]:::network
        click ECHO "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/network/echo-server/"
        
        %% Security
        AUTH[Authelia]:::security
        click AUTH "https://github.com/clarknova99/talos-cluster/tree/main/kubernetes/apps/default/authelia/"
    end

    %% Connections
    Internet -->|External Access| FW
    FW --> SW
    SW --> BL1 & BL2 & BL3 & NUC1 & NUC2 & NAS
    UPS -.->|Power| BL1 & BL2 & BL3 & NUC1 & NUC2 & NAS
    
    BL1 & BL2 & BL3 --> TALOS
    TALOS --> K8S
    K8S --> FLUX
    
    FLUX --> CoreServices
    FLUX --> Applications
    FLUX --> Monitoring
    
    CFLARE -->|Traffic| INGRESS
    INGRESS -->|Routes| Applications
    
    Applications -.->|Storage| OPENEBS & ROOK
    Applications -->|Metrics| PROM
    PROM --> GRAFANA
    Applications -->|Logs| FLUENT
    FLUENT --> LOKI
    LOKI --> GRAFANA

    %% Styles
    classDef hardware fill:#808080,stroke:#000
    classDef network fill:#1E90FF,stroke:#000
    classDef power fill:#FFD700,stroke:#000
    classDef os fill:#4169E1,stroke:#000
    classDef k8s fill:#326CE5,stroke:#000
    classDef platform fill:#4682B4,stroke:#000
    classDef security fill:#FF6347,stroke:#000
    classDef storage fill:#32CD32,stroke:#000
    classDef monitoring fill:#FFA500,stroke:#000
    classDef database fill:#9370DB,stroke:#000
    classDef media fill:#BA55D3,stroke:#000
```
