From e2a095a5d4dbd0cfa0adcfb2926864d3fdb0f9e5 Mon Sep 17 00:00:00 2001 From: Nils Stinnesbeck Date: Wed, 18 Nov 2026 13:11:17 +0100 Subject: [PATCH] k8s: pin the image by digest as well as by tag The registry's digest for 0cfb59c, checked by pulling it from the registry (the local digest differed from the one the registry stores). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw --- Makefile | 2 +- k8s/README.md | 2 +- k8s/base/kustomization.yaml | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4194c6f..9f3a4ea 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ image: ## build and push the image, tagged with the commit (clean tree only); pr @tag=$$(git rev-parse --short HEAD) && \ docker build --build-arg VERSION=$$tag -t $(IMAGE):$$tag . && \ docker push $(IMAGE):$$tag && \ - echo "pushed $(IMAGE):$$tag -> set newTag: $$tag in k8s/base/kustomization.yaml" + echo "pushed $(IMAGE):$$tag -> set newTag: $$tag and its digest in k8s/base/kustomization.yaml (see the comment there)" vet: ## go vet go vet ./... diff --git a/k8s/README.md b/k8s/README.md index 10a6dd1..4322d1b 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -90,5 +90,5 @@ so: - **More than one bootstrap node** on different networks makes the network independent of any single one. Run this on a second cluster or a VPS and add its records next to the first. -- **Upgrades.** `make image` builds and pushes the image tagged with the commit (clean tree only); put that tag in `newTag`, apply again. `allmende version` and the "node running" log line show which commit runs. +- **Upgrades.** `make image` builds and pushes the image tagged with the commit (clean tree only); put that tag in `newTag` and the image digest next to it (how: see the comment in `base/kustomization.yaml`), apply again. The cluster pulls by digest. `allmende version` and the "node running" log line show which commit runs. The pod restarts; peers reconnect on their own. diff --git a/k8s/base/kustomization.yaml b/k8s/base/kustomization.yaml index 0350134..353cfd8 100644 --- a/k8s/base/kustomization.yaml +++ b/k8s/base/kustomization.yaml @@ -28,6 +28,11 @@ images: - name: allmende newName: git.stinnesbeck.com/nils/allmende newTag: 0cfb59c # the commit the image was built from; `make image` pushes and prints the next one + # The digest is what the cluster pulls (the tag above is for people: a tag can + # be overwritten in the registry, a digest cannot). Change both together; get + # the digest after pushing with: podman pull --policy=always : && + # podman image inspect --format '{{.Digest}}' : + digest: sha256:bfcc8462709091a9f5d0fe73ee6b5298194879ffdd5a3110c919362c3e1e0d4b labels: - pairs: