# awlsring/homelab architecture

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

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

## Overview

##### Infrastructure Layer (Top Level)
- AWS Infrastructure (via AWS CDK)
- Kubernetes Infrastructure (via CDK8s)
- Terraform Infrastructure (via CDKTF)
- Flux GitOps System

##### Core Package Libraries (Middle Layer)
- aws-cdk-constructs
- cdk8s-constructs
- cdk8s-crossplane
- cdk8s-plus-minus
- cdktf-constructs
- projects (shared configuration)

##### Application Components (Bottom Layer)
- Various applications deployed to Kubernetes (Jellyfin, Immich, Gatus, etc.)
- Monitoring and observability systems
- Authentication systems (Kanidm)
- Storage systems (Rook-Ceph)

- [Infrastructure Providers]
- ↑↓
- [Core Libraries & Constructs]
- ↑↓
- [Applications & Services]

##### Specific Elements

a. Infrastructure Layer:
- [AWS CDK Stack] ← → [Kubernetes Cluster] ← → [Terraform Resources]
- ↑                     ↑                         ↑
- [AWS Constructs]    [CDK8s Constructs]    [CDKTF Constructs]

b. Platform Services:
- [Cert Manager] ← → [External DNS] ← → [Ingress Controllers]
- ↓                  ↓                    ↓
- [Applications & Services Layer]

c. Application Stack:
- [Media Services]  [Storage Services]  [Monitoring]
- ↓                 ↓                 ↓
- [Persistent Storage Layer (Rook-Ceph)]

##### Important Details to Highlight
- Flux GitOps workflow for Kubernetes
- External secret management
- Networking flow (including Cloudflare integration)
- Storage management
- Monitoring and observability paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef aws fill:#2196F3,stroke:#1565C0,color:white
    classDef k8s fill:#4CAF50,stroke:#388E3C,color:white
    classDef tf fill:#FF9800,stroke:#F57C00,color:white
    classDef lib fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef app fill:#607D8B,stroke:#455A64,color:white
    classDef platform fill:#795548,stroke:#5D4037,color:white

    %% Infrastructure Layer
    subgraph Infrastructure
        AWS["AWS Infrastructure"]:::aws
        K8S["Kubernetes Infrastructure"]:::k8s
        TF["Terraform Infrastructure"]:::tf
        FLUX["Flux GitOps System"]:::k8s
    end

    %% Core Libraries Layer
    subgraph CoreLibs
        AWSC["AWS CDK Constructs"]:::lib
        CDK8SC["CDK8s Constructs"]:::lib
        CDK8SCX["CDK8s Crossplane"]:::lib
        CDK8SPM["CDK8s Plus Minus"]:::lib
        CDKTFC["CDKTF Constructs"]:::lib
        PROJ["Shared Projects"]:::lib
    end

    %% Platform Services Layer
    subgraph Platform
        CERT["Cert Manager"]:::platform
        EXTDNS["External DNS"]:::platform
        EXTSEC["External Secrets"]:::platform
        ING["Ingress Controllers"]:::platform
    end

    %% Applications Layer
    subgraph Apps
        MEDIA["Media Services"]:::app
        AUTH["Authentication"]:::app
        MON["Monitoring"]:::app
        STOR["Storage (Rook-Ceph)"]:::app
    end

    %% Relationships
    AWS --> AWSC
    K8S --> CDK8SC
    K8S --> CDK8SCX
    K8S --> CDK8SPM
    TF --> CDKTFC
    
    FLUX --> K8S
    
    CDK8SC --> Platform
    CERT --> Apps
    EXTDNS --> Apps
    EXTSEC --> Apps
    ING --> Apps
    
    PROJ --> AWS
    PROJ --> K8S
    PROJ --> TF

    %% Click Events
    click AWS "https://github.com/awlsring/Homelab/tree/main/infrastructure/aws/"
    click K8S "https://github.com/awlsring/Homelab/tree/main/infrastructure/kubernetes/"
    click TF "https://github.com/awlsring/Homelab/tree/main/infrastructure/terraform/"
    click FLUX "https://github.com/awlsring/Homelab/tree/main/flux/flux-system/"
    
    click AWSC "https://github.com/awlsring/Homelab/tree/main/packages/aws-cdk-constructs/"
    click CDK8SC "https://github.com/awlsring/Homelab/tree/main/packages/cdk8s-constructs/"
    click CDK8SCX "https://github.com/awlsring/Homelab/tree/main/packages/cdk8s-crossplane/"
    click CDK8SPM "https://github.com/awlsring/Homelab/tree/main/packages/cdk8s-plus-minus/"
    click CDKTFC "https://github.com/awlsring/Homelab/tree/main/packages/cdktf-constructs/"
    click PROJ "https://github.com/awlsring/Homelab/tree/main/packages/projects/"
    
    click CERT "https://github.com/awlsring/Homelab/blob/main/infrastructure/kubernetes/src/charts/system/cert-manager.ts"
    click EXTDNS "https://github.com/awlsring/Homelab/blob/main/infrastructure/kubernetes/src/charts/system/external-dns.ts"
    click EXTSEC "https://github.com/awlsring/Homelab/blob/main/infrastructure/kubernetes/charts/external-secrets.k8s.yaml"
    click ING "https://github.com/awlsring/Homelab/blob/main/infrastructure/kubernetes/charts/nginx-ingress.k8s.yaml"
    
    click MEDIA "https://github.com/awlsring/Homelab/blob/main/infrastructure/kubernetes/charts/jellyfin.k8s.yaml"
    click AUTH "https://github.com/awlsring/Homelab/blob/main/infrastructure/kubernetes/charts/kanidm.k8s.yaml"
    click MON "https://github.com/awlsring/Homelab/blob/main/infrastructure/kubernetes/src/charts/system/monitoring.ts"
    click STOR "https://github.com/awlsring/Homelab/blob/main/infrastructure/kubernetes/charts/rook-ceph.k8s.yaml"
```
