Both contact APIs now have amd64 build+push pipelines: sirius-growth/.forgejo/workflows/deploy-contact.yml (contact-api/) and sirius/websites/.forgejo/workflows/deploy-phs-contact.yml (phs-contact-api/). Each printed the tag for its first run, so the @sha256: pins (which existed only because there was no build path) become ordinary :<sha> tags an operator can bump. docs/site-image-pinning.md: drop the 'no CI build path' section and record the two workflows in the pins table.
6 KiB
Site images: immutable sha tags pinned in git
Every first-party site image runs from a tag pinned in this repo and is rolled
by Flux. CI builds and pushes :<commit-sha> and prints the exact ref; the
operator copies that ref into the Deployment manifest. There are no cluster
credentials in any site repo — CI cannot roll a Deployment and cannot read a
kubeconfig.
This replaces the old model (:latest + imagePullPolicy: Always + CI patching
kubectl.kubernetes.io/restartedAt through a site-deployer ServiceAccount
token). That path is gone: the SA/Role/RoleBinding were removed and the
KUBE_CONFIG action secrets deleted.
Operator flow
-
Push to a site repo (or
workflow_dispatchit). The workflow builds the amd64 image, pushes<registry>/<image>:<sha>, and ends with a### Pin this in sirius/homek8s …step that prints the ref. It also pushes:latest, but nothing in the cluster reads:latest— it is a convenience pointer for humans only. -
Edit the Deployment in
apps/base/<app>/deployment*.yaml:image: forgejo.siriusdevops.com/sirius/<image>:<sha> imagePullPolicy: IfNotPresent -
Commit + push
master, then force the Flux recheck (gitrepository first, kustomization second — anappsannotate that still reports the previous sha has not fetched the commit):kubectl -n flux-system annotate gitrepository flux-system reconcile.fluxcd.io/requestedAt="$(date +%s)" --overwrite kubectl -n flux-system annotate kustomization apps reconcile.fluxcd.io/requestedAt="$(date +%s)" --overwrite -
Verify: the pod template changed, so the Deployment rolls within ~1m and the pod reports the pinned ref.
kubectl -n <ns> get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.containerStatuses[0].imageID}{"\n"}{end}'imageIDmust name:<sha>and carry the digest the registry returns for that tag (Docker-Content-Digest, below).
Rollback is git revert of the pin commit — Flux reconciles back in ~1m.
Why the site repos are not Flux sources
The only GitRepository cluster-wide is flux-system → sirius/homek8s. Flux
owns the manifests; the site repos own only their image builds. The content
revision a visitor sees is therefore chosen by the tag committed here, not by
whatever CI pushed last. A site repo push alone changes nothing in the cluster.
Current pins
| Namespace | Deployment | Image ref |
|---|---|---|
| siriusdevops | siriusdevops-site | siriusdevops-site:f0dde2f48c8224fb80d801ecb0d155c93332dc13 |
| siriusdevops | siriusdevops-contact | siriusdevops-contact:f0dde2f48c8224fb80d801ecb0d155c93332dc13 |
| sirius-growth | sirius-growth-site | sirius-growth-site:ea306b73b0d7c9ae8c33393a420e6d1d452b802b |
| sirius-growth | sirius-growth-portal | sirius-growth-portal:d9e558c4e0922d3ecd28214f7698ec0994170481 |
| sirius-growth | sirius-growth-contact | sirius-growth-contact:c9c9379ebceca6879d3bbeff1c2601b6484e87b0 |
| piedmont | piedmont-site | phs-site:5b590cddab6d7889fdd3c272255f28c4560e752e |
| piedmont | piedmont-contact | phs-contact:5035443abb62913362e416ab7030a64726886886 |
Each pin is the tag CI printed for the commit that was deployed. (The first six pins were chosen as the tag whose manifest was the image already running, so pinning was a no-op for visitors; the two contact APIs were re-pinned after their pipelines first ran — same source, freshly built.)
Contact APIs
Both contact APIs now build in CI, on docker-amd64, tagging :$sha and
promoting :latest as a pointer only:
| Repo | Workflow | paths: |
Source | Image |
|---|---|---|---|---|
sirius-growth (master) |
.forgejo/workflows/deploy-contact.yml |
contact-api/** |
contact-api/ |
sirius/sirius-growth-contact |
sirius/websites (main) |
.forgejo/workflows/deploy-phs-contact.yml |
phs-contact-api/** |
phs-contact-api/ |
sirius/phs-contact |
They used to be hand-built (:latest only) and therefore pinned by @sha256:.
A change to either API is now a push → printed :<sha> ref → bump the pin here.
Registry facts
-
Registry:
forgejo.siriusdevops.com(Forgejo packages,[packages] ENABLED = true). -
Reads/writes need a
read:package/write:packagescoped token; the stored~/.git-credentialsoauth2 token is git-scoped and is rejected by/v2/. -
Tags do not expire.
package_cleanup_rulehas zero rows andapp.inihas no cleanup cron, so a pinned:<sha>stays resolvable. -
Prove a pin
Tfor imageIwithout pulling anything:curl -s -u "sirius:$TOK" -H 'Accept: application/vnd.oci.image.index.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.docker.distribution.manifest.v2+json' \ -D - -o /dev/null "https://forgejo.siriusdevops.com/v2/sirius/$I/manifests/$T" | grep -i docker-content-digest
Pitfalls
docker buildx imagetools create(the:latestpromote step) wraps a single-arch image in an index, so the:latestdigest differs from the:<sha>digest even though the content is identical. Compare the config digest, or compare the running pod's digest to the:<sha>tag, never:latestvs the sha tag.- The amd64 runner's job image (
node:20-bullseye) has no docker CLI, so the site workflows fetch the binaries each run — and both hosts have been observed to stall for the full 300s (curl: (28) … 0 out of 0 bytes). The static docker client triesdownload.docker.comthenmirrors.aliyun.com; buildx is copied out of thedocker:27-dindimage the runner already holds (docker create docker:27-dind→docker cp …/cli-plugins/docker-buildx), with the GitHub release URL only as a fallback. Before that change a three-attempt retry of the GitHub CDN failed all three times inside a job container while the same URL fetched fine outside one. runs-onmatters: site images arelinux/amd64and only siriussec serves them. Build them ondocker-amd64/deploy-arm64, never on the arm64dockerrunner.