# keremar/homelab-infrastructure architecture

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

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

## Overview

#### Purpose and Entry Points
This repository is an operational blueprint for building and running a Kubernetes-based microservice platform, from Proxmox cluster provisioning through CI/CD, GitOps, and observability. The numbered directories define the intended execution order. Primary operator entry points are:
- `1-Bootstrap Cluster/1A-IMAGEBUILDER_CAPI_PROXMOX.md`
- `3-Kubectl-Deploy/3B-Kubectl-Deploy.md`
- `5-ArgoCD/5A-ArgoCD.md`

#### 1. Cluster Foundation
A Kubernetes cluster is bootstrapped on Proxmox using Cluster API/image-building guidance, with Calico providing the cluster network layer. This is the infrastructure boundary: subsequent manifests assume a functioning cluster, worker nodes, storage connectivity, and CNI.
- `1-Bootstrap Cluster/cluster.yaml`
- `1-Bootstrap Cluster/calico.yaml`
- `1-Bootstrap Cluster/1A-IMAGEBUILDER_CAPI_PROXMOX.md`

#### 2. External Traffic and Gateway Layer
MetalLB exposes LoadBalancer services on the local network, while NGINX Gateway Fabric implements Gateway API routing. A shared gateway is the north-south ingress boundary; application and platform UIs attach through `HTTPRoute` resources rather than application-specific ingress controllers.
- `2-MetalLB-NGINXGatewayFabric/metallb-config.yaml`
- `2-MetalLB-NGINXGatewayFabric/shared-gateway.yaml`
- `2-MetalLB-NGINXGatewayFabric/2A-MetalLB-NGINXGatewayFabric.md`

#### 3. Stateful Platform Storage and Workloads
Longhorn is configured as the persistent-storage provider. The deployed system consists of frontend, todo-service, and user-service workloads in staging and production, with per-service databases modeled as StatefulSets plus Services. This creates a service-to-database boundary and makes persistent volumes a cluster-level dependency.
- `3-Kubectl-Deploy/longhorn-storageclass.yaml`
- `3-Kubectl-Deploy/production/todo-service/templates/database-statefulset.yaml`
- `3-Kubectl-Deploy/production/user-service/templates/database-statefulset.yaml`

#### 4. Progressive Application Delivery
Applications are represented as Kubernetes workload templates with Argo Rollouts resources, stable/canary Services, and AnalysisTemplates. Traffic reaches the frontend through an HTTPRoute; internal service access is mediated through Kubernetes Services. Staging additionally contains config/hot-reload-related resources for the todo service.
- `6-Helm-Deploy/frontend/templates/rollout.yaml`
- `6-Helm-Deploy/todo-service/templates/canary-service.yaml`
- `6-Helm-Deploy/user-service/templates/analysistemplate.yaml`

#### 5. Deployment Packaging and Environment Boundary
The repository evolves from direct Kubernetes manifests under `3-Kubectl-Deploy` to reusable Helm charts under `6-Helm-Deploy`. Each application chart has common defaults and separate staging/production values, making environment configuration a values-level concern while preserving common templates.
- `6-Helm-Deploy/frontend/Chart.yaml`
- `6-Helm-Deploy/todo-service/values-staging.yaml`
- `6-Helm-Deploy/user-service/values-production.yaml`

#### 6. CI, Quality, and GitOps Control Plane
Jenkins supplies CI execution, including purpose-built Python-test and Kubernetes-tools images. SonarQube and Dependency-Track provide code-quality and dependency/security analysis services, backed by PostgreSQL/PVC configuration. Argo CD is the GitOps reconciliation boundary that can apply desired Helm/Kubernetes state to the cluster.
- `4-Jenkins-Setup/jenkins-values.yaml`
- `4-Jenkins-Setup/sonarqube-values.yaml`
- `5-ArgoCD/argocd-cmd-params-cm.yaml`

#### 7. Observability Data Plane
Grafana Alloy is configured as the telemetry collection/forwarding layer for metrics, logs, and traces. Prometheus, Elasticsearch/Kibana, Jaeger, and Grafana form the main observability services; PVCs and secrets identify persistence and credential boundaries. Dashboards provide operational views over cluster and microservice behavior.
- `7_Observability-Stack/metrics/alloy-metrics-config.yaml`
- `7_Observability-Stack/logs/alloy-logs-config.yaml`
- `7_Observability-Stack/traces/alloy-traces-config.yaml`

Main entry points: [`1-Bootstrap Cluster/cluster.yaml`](https://github.com/keremar/homelab-infrastructure/blob/main/1-Bootstrap%20Cluster/cluster.yaml) (Kubernetes cluster), [`7_Observability-Stack/metrics/alloy-metrics-config.yaml`](https://github.com/keremar/homelab-infrastructure/blob/main/7_Observability-Stack/metrics/alloy-metrics-config.yaml) (Grafana Alloy), [`6-Helm-Deploy/frontend/templates/rollout.yaml`](https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/frontend/templates/rollout.yaml) (Frontend rollout), [`3-Kubectl-Deploy/production/todo-service/templates/database-statefulset.yaml`](https://github.com/keremar/homelab-infrastructure/blob/main/3-Kubectl-Deploy/production/todo-service/templates/database-statefulset.yaml) (Per-service databases)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundation["Cluster Foundation"]
  node_cluster_bootstrap["Proxmox cluster bootstrap<br/>Cluster API guidance"]
  node_kubernetes_cluster{{"Kubernetes cluster<br/>runtime platform<br/>[cluster.yaml]"}}
  node_calico["Calico<br/>CNI<br/>[calico.yaml]"]
  node_longhorn[("Longhorn storage<br/>persistent storage")]
end

subgraph group_traffic["Traffic Layer"]
  node_metallb["MetalLB<br/>LoadBalancer provider"]
  node_shared_gateway["Shared gateway<br/>NGINX Gateway Fabric"]
end

subgraph group_applications["Application Platform"]
  node_frontend["Frontend rollout<br/>Argo Rollout<br/>[rollout.yaml]"]
  node_todo_service["Todo service<br/>canary workload"]
  node_user_service["User service<br/>canary workload"]
  node_service_databases[("Per-service databases<br/>StatefulSets")]
end

subgraph group_delivery["Delivery Control Plane"]
  node_helm_charts["Application Helm charts<br/>deployment packages<br/>[Chart.yaml]"]
  node_environment_values["Staging and production values<br/>Helm configuration"]
  node_jenkins["Jenkins<br/>CI executor"]
  node_quality_security["Quality and dependency analysis<br/>SonarQube / Dependency-Track"]
  node_argocd["Argo CD<br/>GitOps reconciler"]
end

subgraph group_observability["Observability"]
  node_alloy["Grafana Alloy<br/>telemetry collector"]
  node_metrics_backend["Prometheus and Grafana<br/>metrics and dashboards"]
  node_logs_backend["Elasticsearch and Kibana<br/>log storage and search"]
  node_traces_backend["Jaeger<br/>trace backend"]
end

node_cluster_bootstrap -->|"provisions"| node_kubernetes_cluster
node_calico -->|"networks"| node_kubernetes_cluster
node_longhorn -->|"provides PVCs"| node_kubernetes_cluster
node_metallb -->|"exposes"| node_shared_gateway
node_shared_gateway -->|"HTTPRoute traffic"| node_frontend
node_frontend -->|"internal service calls"| node_todo_service
node_frontend -->|"internal service calls"| node_user_service
node_todo_service -->|"uses database service"| node_service_databases
node_user_service -->|"uses database service"| node_service_databases
node_longhorn -->|"persists volumes"| node_service_databases
node_environment_values -->|"configures"| node_helm_charts
node_jenkins -->|"runs analysis"| node_quality_security
node_jenkins -.->|"builds and validates"| node_helm_charts
node_argocd -->|"reconciles desired state"| node_helm_charts
node_argocd -->|"deploys to"| node_kubernetes_cluster
node_kubernetes_cluster -->|"emits telemetry"| node_alloy
node_alloy -->|"forwards metrics"| node_metrics_backend
node_alloy -->|"forwards logs"| node_logs_backend
node_alloy -->|"forwards traces"| node_traces_backend

click node_cluster_bootstrap "https://github.com/keremar/homelab-infrastructure/blob/main/1-Bootstrap%20Cluster/1A-IMAGEBUILDER_CAPI_PROXMOX.md"
click node_kubernetes_cluster "https://github.com/keremar/homelab-infrastructure/blob/main/1-Bootstrap%20Cluster/cluster.yaml"
click node_calico "https://github.com/keremar/homelab-infrastructure/blob/main/1-Bootstrap%20Cluster/calico.yaml"
click node_longhorn "https://github.com/keremar/homelab-infrastructure/blob/main/3-Kubectl-Deploy/longhorn-storageclass.yaml"
click node_metallb "https://github.com/keremar/homelab-infrastructure/blob/main/2-MetalLB-NGINXGatewayFabric/metallb-config.yaml"
click node_shared_gateway "https://github.com/keremar/homelab-infrastructure/blob/main/2-MetalLB-NGINXGatewayFabric/shared-gateway.yaml"
click node_frontend "https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/frontend/templates/rollout.yaml"
click node_todo_service "https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/todo-service/templates/canary-service.yaml"
click node_user_service "https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/user-service/templates/analysistemplate.yaml"
click node_service_databases "https://github.com/keremar/homelab-infrastructure/blob/main/3-Kubectl-Deploy/production/todo-service/templates/database-statefulset.yaml"
click node_helm_charts "https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/frontend/Chart.yaml"
click node_environment_values "https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/todo-service/values-staging.yaml"
click node_jenkins "https://github.com/keremar/homelab-infrastructure/blob/main/4-Jenkins-Setup/jenkins-values.yaml"
click node_quality_security "https://github.com/keremar/homelab-infrastructure/blob/main/4-Jenkins-Setup/sonarqube-values.yaml"
click node_argocd "https://github.com/keremar/homelab-infrastructure/blob/main/5-ArgoCD/argocd-cmd-params-cm.yaml"
click node_alloy "https://github.com/keremar/homelab-infrastructure/blob/main/7_Observability-Stack/metrics/alloy-metrics-config.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cluster_bootstrap,node_kubernetes_cluster,node_calico,node_longhorn toneBlue
class node_metallb,node_shared_gateway toneAmber
class node_frontend,node_todo_service,node_user_service,node_service_databases toneMint
class node_helm_charts,node_environment_values,node_jenkins,node_quality_security,node_argocd toneRose
class node_alloy,node_metrics_backend,node_logs_backend,node_traces_backend toneIndigo
```

## Components

### Cluster Foundation

- [Proxmox cluster bootstrap](https://github.com/keremar/homelab-infrastructure/blob/main/1-Bootstrap%20Cluster/1A-IMAGEBUILDER_CAPI_PROXMOX.md): Cluster API guidance · Builds the Kubernetes cluster and worker foundation. · `1-Bootstrap Cluster/1A-IMAGEBUILDER_CAPI_PROXMOX.md`
- [Kubernetes cluster](https://github.com/keremar/homelab-infrastructure/blob/main/1-Bootstrap%20Cluster/cluster.yaml): runtime platform · `1-Bootstrap Cluster/cluster.yaml`
- [Calico](https://github.com/keremar/homelab-infrastructure/blob/main/1-Bootstrap%20Cluster/calico.yaml): CNI · `1-Bootstrap Cluster/calico.yaml`
- [Longhorn storage](https://github.com/keremar/homelab-infrastructure/blob/main/3-Kubectl-Deploy/longhorn-storageclass.yaml): persistent storage · `3-Kubectl-Deploy/longhorn-storageclass.yaml`

### Traffic Layer

- [MetalLB](https://github.com/keremar/homelab-infrastructure/blob/main/2-MetalLB-NGINXGatewayFabric/metallb-config.yaml): LoadBalancer provider · `2-MetalLB-NGINXGatewayFabric/metallb-config.yaml`
- [Shared gateway](https://github.com/keremar/homelab-infrastructure/blob/main/2-MetalLB-NGINXGatewayFabric/shared-gateway.yaml): NGINX Gateway Fabric · North-south Gateway API boundary. · `2-MetalLB-NGINXGatewayFabric/shared-gateway.yaml`

### Application Platform

- [Frontend rollout](https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/frontend/templates/rollout.yaml): Argo Rollout · Receives external application traffic. · `6-Helm-Deploy/frontend/templates/rollout.yaml`
- [Todo service](https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/todo-service/templates/canary-service.yaml): canary workload · `6-Helm-Deploy/todo-service/templates/canary-service.yaml`
- [User service](https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/user-service/templates/analysistemplate.yaml): canary workload · Uses rollout analysis during progressive delivery. · `6-Helm-Deploy/user-service/templates/analysistemplate.yaml`
- [Per-service databases](https://github.com/keremar/homelab-infrastructure/blob/main/3-Kubectl-Deploy/production/todo-service/templates/database-statefulset.yaml): StatefulSets · Todo and user services each retain persistent database state. · `3-Kubectl-Deploy/production/todo-service/templates/database-statefulset.yaml`

### Delivery Control Plane

- [Application Helm charts](https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/frontend/Chart.yaml): deployment packages · Common workload templates replace direct manifest deployment. · `6-Helm-Deploy/frontend/Chart.yaml`
- [Staging and production values](https://github.com/keremar/homelab-infrastructure/blob/main/6-Helm-Deploy/todo-service/values-staging.yaml): Helm configuration · Separates environment settings from shared templates. · `6-Helm-Deploy/todo-service/values-staging.yaml`
- [Jenkins](https://github.com/keremar/homelab-infrastructure/blob/main/4-Jenkins-Setup/jenkins-values.yaml): CI executor · `4-Jenkins-Setup/jenkins-values.yaml`
- [Quality and dependency analysis](https://github.com/keremar/homelab-infrastructure/blob/main/4-Jenkins-Setup/sonarqube-values.yaml): SonarQube / Dependency-Track · CI quality and dependency-security services use persistent backing storage. · `4-Jenkins-Setup/sonarqube-values.yaml`
- [Argo CD](https://github.com/keremar/homelab-infrastructure/blob/main/5-ArgoCD/argocd-cmd-params-cm.yaml): GitOps reconciler · Applies desired Helm and Kubernetes state to the cluster. · `5-ArgoCD/argocd-cmd-params-cm.yaml`

### Observability

- [Grafana Alloy](https://github.com/keremar/homelab-infrastructure/blob/main/7_Observability-Stack/metrics/alloy-metrics-config.yaml): telemetry collector · Collects and forwards metrics, logs, and traces. · `7_Observability-Stack/metrics/alloy-metrics-config.yaml`
- **Prometheus and Grafana**: metrics and dashboards
- **Elasticsearch and Kibana**: log storage and search
- **Jaeger**: trace backend

## Connections

- Proxmox cluster bootstrap → Kubernetes cluster: provisions
- Calico → Kubernetes cluster: networks
- Longhorn storage → Kubernetes cluster: provides PVCs
- MetalLB → Shared gateway: exposes
- Shared gateway → Frontend rollout: HTTPRoute traffic
- Frontend rollout → Todo service: internal service calls
- Frontend rollout → User service: internal service calls
- Todo service → Per-service databases: uses database service
- User service → Per-service databases: uses database service
- Longhorn storage → Per-service databases: persists volumes
- Staging and production values → Application Helm charts: configures
- Jenkins → Quality and dependency analysis: runs analysis
- Jenkins → Application Helm charts: builds and validates
- Argo CD → Application Helm charts: reconciles desired state
- Argo CD → Kubernetes cluster: deploys to
- Kubernetes cluster → Grafana Alloy: emits telemetry
- Grafana Alloy → Prometheus and Grafana: forwards metrics
- Grafana Alloy → Elasticsearch and Kibana: forwards logs
- Grafana Alloy → Jaeger: forwards traces
