# m1xxos/homelab architecture

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

## Overview

##### Main Components

a. Infrastructure Layer:
- Proxmox as the base virtualization platform
- Network infrastructure (including HAProxy and Keepalived for load balancing)
- Storage systems (NFS)

b. Container Orchestration Layer:
- K3s Kubernetes clusters
- Docker environments

c. GitOps and Management Layer:
- ArgoCD
- Portainer
- Cluster API

d. Service Layer:
- Application services (like the frog-app)
- Arr-stack applications
- Monitoring stack

##### Physical Infrastructure Layer
- Network components (HAProxy/Keepalived)
- Storage systems (NFS)

##### Virtualization Layer
- Ubuntu VMs created by Packer
- Terraform management
- Docker hosts

##### Container Orchestration Layer
- K3s Kubernetes clusters
- K8s components:
- Traefik Ingress
- MetalLB
- Cert-Manager
- Longhorn storage

##### Management Layer
- ArgoCD
- Cluster API
- External Secrets
- Crossplane

##### Application Layer
- Arr-stack (Sonarr, Radarr, etc.)
- Monitoring stack (Prometheus, Grafana, Loki)
- Custom applications

##### Connection and Flow Representation

- Infrastructure connections (e.g., blue)
- Data flow (e.g., green)
- Management/control flow (e.g., orange)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Physical Infrastructure"
        PROX[Proxmox]:::infra
        click PROX "https://github.com/m1xxos/homelab/tree/main/proxmox-packer"
        LB["HAProxy/Keepalived"]:::infra
        click LB "https://github.com/m1xxos/homelab/tree/main/ansible/loadbalancer"
        NFS[NFS Storage]:::storage
        click NFS "https://github.com/m1xxos/homelab/blob/main/ansible/playbooks/nfs-server.yaml"
    end

    subgraph "Virtualization Layer"
        UBUNTU[Ubuntu VMs]:::vm
        DOCKER[Docker Environment]:::container
        click DOCKER "https://github.com/m1xxos/homelab/tree/main/docker"
    end

    subgraph "Container Orchestration"
        K3S[K3s Cluster]:::k8s
        click K3S "https://github.com/m1xxos/homelab/blob/main/ansible/loadbalancer/files/k3s-config.yaml"
        TRAEFIK[Traefik Ingress]:::k8s
        click TRAEFIK "https://github.com/m1xxos/homelab/tree/main/clusters/main/traefik"
        METALLB[MetalLB]:::k8s
        click METALLB "https://github.com/m1xxos/homelab/tree/main/clusters/main/mettallb-system"
        CERT[Cert-Manager]:::k8s
        click CERT "https://github.com/m1xxos/homelab/tree/main/clusters/main/cert-manager"
        LONG[Longhorn Storage]:::storage
        click LONG "https://github.com/m1xxos/homelab/tree/main/clusters/main/longhorn"
    end

    subgraph "Management Layer"
        ARGO[ArgoCD]:::mgmt
        click ARGO "https://github.com/m1xxos/homelab/tree/main/kuber/argocd"
        CAPI[Cluster API]:::mgmt
        click CAPI "https://github.com/m1xxos/homelab/tree/main/clusters/main/capi-system"
        CROSS[Crossplane]:::mgmt
        click CROSS "https://github.com/m1xxos/homelab/blob/main/argo-apps/templates/crossplane.yaml"
    end

    subgraph "Application Layer"
        FROG[Frog App]:::app
        click FROG "https://github.com/m1xxos/homelab/tree/main/kuber/frog-app"
        ARR[Arr-stack]:::app
        click ARR "https://github.com/m1xxos/homelab/tree/main/kuber/arrstack"
        MON[Monitoring Stack]:::app
        click MON "https://github.com/m1xxos/homelab/tree/main/kuber/kube-prometheus-stack"
    end

    %% Infrastructure Connections
    PROX --> UBUNTU
    UBUNTU --> K3S
    UBUNTU --> DOCKER
    LB --> K3S
    NFS --> K3S

    %% Container Orchestration Connections
    K3S --> TRAEFIK
    K3S --> METALLB
    K3S --> CERT
    K3S --> LONG

    %% Management Layer Connections
    ARGO --> K3S
    CAPI --> K3S
    CROSS --> K3S

    %% Application Layer Connections
    TRAEFIK --> FROG
    TRAEFIK --> ARR
    TRAEFIK --> MON

    %% Styling
    classDef infra fill:#b3e0ff,stroke:#0066cc
    classDef storage fill:#ffcc99,stroke:#ff8000
    classDef vm fill:#d9b3ff,stroke:#6600cc
    classDef container fill:#b3ffb3,stroke:#00cc00
    classDef k8s fill:#ffb3b3,stroke:#cc0000
    classDef mgmt fill:#ffff99,stroke:#cccc00
    classDef app fill:#ff99ff,stroke:#cc00cc

    %% Legend
    subgraph Legend
        L1[Infrastructure]:::infra
        L2[Storage]:::storage
        L3[Virtual Machines]:::vm
        L4[Containers]:::container
        L5[Kubernetes]:::k8s
        L6[Management]:::mgmt
        L7[Applications]:::app
    end
```
