Registry
Images are built once, scanned, signed and stored; clusters pull them from a nearby mirror.
The CityScript
This is all there is to it. Change it in the editor and the city redraws.
%% R · Registry
%% Nothing runs unless it was scanned and signed. The mirror keeps pulls fast and the origin quiet.
city 48x32
district supply "Software supply chain" 3,3..27,12
district runtime "Where images run" 31,3..45,14
building source tower in supply "Source repo"
floor source.f "Code"
room source.repo storage "shop repo"
building registry warehouse in supply "Registry"
floor registry.f "Images"
room registry.images storage "Images" port=5000
room registry.charts storage "Helm charts" port=5000
building scanner tower in supply "Scanner"
floor scanner.f "Security"
room scanner.trivy worker "Vulnerability scan"
room scanner.sign worker "Signing" secret=signing-key
building mirror depot in supply "Regional mirror"
floor mirror.f "Cache"
room mirror.cache cache "Pull-through cache" port=5000
building cluster factory in runtime "Cluster"
floor cluster.f "Nodes"
room cluster.kubelet worker "Image pulls"
room cluster.policy config "Only signed images"
pipeline publish "Publish an image" source -> [build] -> [scan] -> [sign] -> [push] -> registry -> [replicate] -> mirror
step source "A change to the image's recipe is merged"
step registry "The image is built, scanned, signed and stored"
step mirror "A copy is kept close to where it is used"
run build "docker build -t registry.shop.example/shop:$SHA ."
run scan "trivy image --exit-code 1 registry.shop.example/shop:$SHA"
run sign "cosign sign --key $COSIGN_KEY registry.shop.example/shop:$SHA"
run push "docker push registry.shop.example/shop:$SHA"
run replicate "skopeo copy docker://registry.shop.example/shop:$SHA docker://mirror.shop.example/shop:$SHA"
link cluster.kubelet -> mirror.cache "pull image" variant=emphasis
link cluster.policy -> scanner.sign "verify signature" variant=security
link scanner.trivy -> registry.images "scan"