# vlot-ltd/homelab architecture

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

## Overview

##### Project Type and Purpose
This is a homelab infrastructure automation project that aims to create a simplified, codified, and documented home lab environment for testing various technologies. The project uses Infrastructure as Code (IaC) tools to manage the entire stack.

##### Main Components

A. Infrastructure Layer:
- Proxmox VE (Primary virtualization platform)
- Raspberry Pi cluster (for specific workloads)
- Storage Systems (TrueNAS)

B. Infrastructure Management Layer:
- Packer (Image building)
- Terraform (Infrastructure provisioning)
- Ansible (Configuration management)

C. Service Layer:
- Kubernetes (K3s)
- HashiCorp Vault
- Active Directory
- Monitoring systems
- Plex Media Server
- AWX
- Rancher
- CloudStack

**┌─ Application Layer ─────────────────────┐**
- (Plex, Home Assistant, NetBox, etc.)    │
- Platform Layer ──────────────────────┐ │
- (K3s, Rancher, Active Directory)      │ │
- Management Layer ───────────────────┐ │ │
- (Terraform, Packer, Ansible)         │ │ │
- Infrastructure Layer ──────────────┐ │ │ │
- (Proxmox, TrueNAS, Raspberry Pi)    │ │ │ │
- ┴─┴─┴─┘

##### Key Relationships to Highlight

- Packer → Proxmox (VM template creation)
- Terraform → Proxmox (VM provisioning)
- Ansible → VMs (Configuration management)
- K3s → VMs (Container orchestration)
- Vault → Services (Secret management)

##### Special Notes

- Raspberry Pi components as "Edge/Experimental"
- Backup paths and storage relationships
- Monitoring data flow
- Automation workflows

- ▢ Infrastructure         │
- ◇ Management Tools       │
- ○ Platform Services      │
- △ Applications          │
- → Direct Dependency     │
- ⟢ Data Flow            │
- Optional Connection │
- ┘

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef infrastructure fill:#e6e6e6,stroke:#333
    classDef management fill:#d1e7dd,stroke:#333
    classDef platform fill:#fff3cd,stroke:#333
    classDef application fill:#e2d9f3,stroke:#333
    
    %% Infrastructure Layer
    subgraph InfrastructureLayer["Infrastructure Layer"]
        Proxmox["Proxmox VE"]
        TrueNAS["TrueNAS Storage"]
        RaspberryPi["Raspberry Pi Cluster"]:::infrastructure
    end
    
    %% Management Layer
    subgraph ManagementLayer["Management Layer"]
        Packer["Packer\nImage Building"]
        Terraform["Terraform\nProvisioning"]
        Ansible["Ansible\nConfiguration"]
    end
    
    %% Platform Layer
    subgraph PlatformLayer["Platform Layer"]
        K3s["Kubernetes (K3s)"]
        Vault["HashiCorp Vault"]
        AD["Active Directory"]
        AWX["AWX"]
        Rancher["Rancher"]
        CloudStack["CloudStack"]
    end
    
    %% Application Layer
    subgraph ApplicationLayer["Application Layer"]
        Plex["Plex Media Server"]
        HomeAssistant["Home Assistant"]
        Monitoring["Monitoring Systems"]
    end
    
    %% Relationships
    Packer --> Proxmox
    Terraform --> Proxmox
    Ansible --> Proxmox
    K3s --> Proxmox
    Vault --> K3s
    AD --> Proxmox
    AWX --> Ansible
    Rancher --> K3s
    CloudStack --> Proxmox
    K3s --> RaspberryPi
    TrueNAS --> Proxmox
    
    %% Application Dependencies
    Plex --> K3s
    HomeAssistant --> K3s
    Monitoring --> K3s
    
    %% Legend
    subgraph Legend["Legend"]
        L1["Infrastructure"]:::infrastructure
        L2["Management Tools"]:::management
        L3["Platform Services"]:::platform
        L4["Applications"]:::application
    end
    
    %% Click Events
    click Proxmox "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/terraform/modules/pve-vm/"
    click Packer "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/packer/"
    click Terraform "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/terraform/"
    click Ansible "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/ansible/"
    click K3s "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/ansible/roles/k3s/"
    click Vault "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/ansible/roles/hashi_vault/"
    click AD "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/ansible/roles/domain_controller/"
    click AWX "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/ansible/roles/awx/"
    click Rancher "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/ansible/roles/rancher/"
    click CloudStack "https://github.com/Vlot-Ltd/homelab/tree/main/examples/homelab-monorepo/ansible/roles/cloudstack_common/"
    click RaspberryPi "https://github.com/Vlot-Ltd/homelab/blob/main/docs/raspberrypi.md"
    click TrueNAS "https://github.com/Vlot-Ltd/homelab/blob/main/docs/truenas.md"
    
    %% Apply styles
    class Proxmox,TrueNAS,RaspberryPi infrastructure
    class Packer,Terraform,Ansible management
    class K3s,Vault,AD,AWX,Rancher,CloudStack platform
    class Plex,HomeAssistant,Monitoring application
```
