@startuml c4-deployment
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/v2.11.0/C4_Deployment.puml

' Modern flat styling: no shadows, sharper corners, clean sans-serif, modern palette.
skinparam backgroundColor #FAFAFA
skinparam shadowing false
skinparam roundCorner 4
skinparam defaultFontName "Inter, Helvetica, Arial, sans-serif"
skinparam defaultFontSize 13
skinparam ArrowColor #37474F
skinparam ArrowThickness 1.2
skinparam rectangleBorderThickness 1.3

UpdateElementStyle("container",   $fontColor="#FFFFFF", $bgColor="#2563EB", $borderColor="#1E3A8A")
UpdateElementStyle("container_db",$fontColor="#FFFFFF", $bgColor="#7C3AED", $borderColor="#4C1D95")
UpdateBoundaryStyle($bgColor="#F1F5F9", $borderColor="#94A3B8", $fontColor="#1E293B")

title Deployment diagram — Kind cluster (local dev)

Deployment_Node(host, "Developer Workstation", "Linux / macOS") {
    Deployment_Node(kind, "Kind Cluster", "Kubernetes via KinD") {

        Deployment_Node(metallb, "MetalLB", "Layer-2 LoadBalancer controller — assigns external IP to the gateway Service")

        Deployment_Node(ns_gw, "namespace: gateway") {
            Container(gateway_pod, "gateway pod", "Spring Boot 4.0.5, Java 25", ":8080 — Service type LoadBalancer")
        }
        Deployment_Node(ns_emp, "namespace: employee") {
            Container(employee_pod, "employee pod", "Spring Boot 4.0.5, Java 25", ":8080 — Service type ClusterIP")
        }
        Deployment_Node(ns_dept, "namespace: department") {
            Container(department_pod, "department pod", "Spring Boot 4.0.5, Java 25", ":8080 — Service type ClusterIP")
        }
        Deployment_Node(ns_org, "namespace: organization") {
            Container(organization_pod, "organization pod", "Spring Boot 4.0.5, Java 25", ":8080 — Service type ClusterIP")
        }
        Deployment_Node(ns_mongo, "namespace: mongo") {
            ContainerDb(mongo_pod, "mongodb pod", "MongoDB 8.0", ":27017 — Service type ClusterIP")
        }
        Deployment_Node(ns_obs, "namespace: observability") {
            Container(jaeger_pod, "jaeger pod", "Jaeger 2.17 (OTel Collector-based)", ":16686 UI (LoadBalancer), :4318 OTLP/HTTP (ClusterIP)")
        }
    }
}

Rel(metallb,  gateway_pod, "assigns LoadBalancer IP, routes TCP :8080")
Rel(metallb,  jaeger_pod,  "assigns LoadBalancer IP, routes TCP :16686")
Rel_D(employee_pod,     mongo_pod, "reads/writes", "MongoDB wire")
Rel_D(department_pod,   mongo_pod, "reads/writes", "MongoDB wire")
Rel_D(organization_pod, mongo_pod, "reads/writes", "MongoDB wire")

Rel(gateway_pod,      jaeger_pod, "OTLP/HTTP :4318")
Rel(employee_pod,     jaeger_pod, "OTLP/HTTP :4318")
Rel(department_pod,   jaeger_pod, "OTLP/HTTP :4318")
Rel(organization_pod, jaeger_pod, "OTLP/HTTP :4318")

SHOW_LEGEND()
@enduml
