Kubernetes — Workloads, Storage and Config
A cluster drawn in pure Kubernetes objects, with the distinction the notation exists to make visible: a Deployment is stateless and replicated, a StatefulSet has a volume claim behind it, and the two must not be drawn the same way. Reports clean.
Make it your own.
title "Platform cluster"
provider k8s
internet {
user users "Users"
}
cluster prod "prod-cluster" {
namespace ingress-ns "ingress-nginx" {
ingress ing "nginx ingress"
service ing-svc "ingress service"
}
namespace app-ns "application" {
deployment web "web" count 4 tier web
service web-svc "web service"
deployment worker "worker" count 3 tier worker
configmap cfg "app-config"
secret creds "db-credentials"
hpa auto "web autoscaler"
}
namespace data-ns "data" {
statefulset pg "postgres" count 3
service pg-svc "postgres service"
pvc pgdata "postgres-data"
storageclass fast "fast-ssd"
}
namespace obs-ns "observability" {
deployment prom "prometheus"
}
}
users -> ing : https 443
ing -> ing-svc : http 80
ing-svc -> web-svc : http 8080
web-svc -> web : http 8080
web -> cfg : mount
web -> creds : mount
web ~> worker : job queue
web -> pg-svc : postgres 5432
pg-svc -> pg : postgres 5432
pg -> pgdata : volume
pgdata ..> fast
auto ..> web
prom ..> web
prom ..> worker
prom ..> pg