@startuml

!includeurl https://raw.githubusercontent.com/michiel/plantuml-kubernetes-sprites/master/resource/k8s-sprites-unlabeled-25pct.iuml

!define ICONURL https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/v2.4.0
!includeurl ICONURL/font-awesome-5/key.puml
!includeurl ICONURL/font-awesome-5/warehouse.puml
!includeurl ICONURL/font-awesome-5/user_secret.puml
!includeurl ICONURL/font-awesome-5/robot.puml

!define CLOUDOGUURL https://raw.githubusercontent.com/cloudogu/plantuml-cloudogu-sprites/master
!includeurl CLOUDOGUURL/tools/k8s.puml

!define CLOUDOGU_BLUE #23a3dd

!define COLOR_ABOVE_TRANSPARENT_BACKGROUND WHITE

skinparam backgroundcolor TRANSPARENT
skinparam actorStyle awesome


    
rectangle "<$k8s>\nK8s" as k8s {
    rectangle "<$robot>\nExternal\nSecrets\nOperator" as ESO
    
    rectangle "<$ns>\nNamespace" as ns {
        collections "<$secret>\nSecrets" as secrets
        collections "<$pod>\nPods" as pods
        together {
            collections "<$user_secret>\nExternalSecrets\n- specify path in vault" as ES
            rectangle "<$warehouse>\nSecretStore" as Store
        }
        rectangle "<$sa>\nService Account" as sa
    }
    rectangle "<$key>\nVault" as vault
}


ESO --> Store : read
ESO --> ES : read
ESO --> vault : read\n(using info from ES+SS)
'ESO --> vault : uses info from\n ExternalSecret + SecretStore\nto read actual secret 
ESO -> secrets : create
secrets <-- pods : use
ES -> Store: reference
Store --> sa : reference
Store -> vault : reference


skinparam arrow {
  Color BLACK
}

skinparam node {
  BorderColor CLOUDOGU_BLUE
}

skinparam actor {
  BackgroundColor #23a3dd
  BorderColor #16688d
  FontColor #000000
}

skinparam actor {
    BackgroundColor CLOUDOGU_BLUE
    BorderColor #16688d
}

skinparam rectangle {
    BackgroundColor WHITE
    BorderColor CLOUDOGU_BLUE
    FontColor CLOUDOGU_BLUE
}

skinparam collections {
    BackgroundColor WHITE
    BorderColor CLOUDOGU_BLUE
    FontColor CLOUDOGU_BLUE
}

skinparam interface {
    BackgroundColor WHITE
    BorderColor #16688d
}

skinparam note {
    BackgroundColor WHITE
    BorderColor #16688d
}

skinparam rectangle<<Hidden>> {
    textColor Transparent
    borderColor Transparent
    backgroundColor Transparent
    fontColor Transparent
    stereotypeFontColor Transparent
}


@enduml