feat(gke): auto-track preview backend image via ArgoCD Image Updater#114
Merged
Merged
Conversation
The deployment + migrate-job templates rendered image as '<repo>:<tag>'. With auto-tracking, image.tag will receive a digest of the form 'sha256:<hex>' written by the image-updater controller, which needs '@' as the separator, not ':'. A small trakrf-backend.image helper switches on the 'sha256:' prefix and keeps both forms working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the upstream argocd-image-updater chart as an ArgoCD-managed Application, gated on cluster=gke. Runs in the argocd namespace with in-cluster ArgoCD API access via the chart-managed Role + RoleBinding, so no token plumbing is needed. ARM toleration on the controller pod. Chart pinned at 1.2.2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The trakrf-backend-preview Application carries digest-strategy annotations watching ghcr.io/trakrf/backend:preview. Annotations are gated on env=preview AND cluster=gke — the prod Application is never annotated (manual tag promotion stays the contract), and AKS/EKS overlays don't surface stray annotations on Applications nothing is watching. Write-back is argocd: image-updater patches helm.parameters on the Application, leaving values-gke.yaml.image.tag as the bootstrap pin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
argocd-image-updaterchart as a GKE-only ArgoCD-managed Application, watchingghcr.io/trakrf/backend:previewwithdigestupdate-strategy.trakrf-backend-previewApplication so the controller patcheshelm.parameters.image.tagwith the resolved digest on every change; prod is intentionally never annotated (manual tag promotion stays the contract).helm/trakrf-backendchart to render either a<repo>:<tag>or<repo>@<digest>image reference based on the shape ofimage.tag, so the same field accepts a human-pinnedsha-<short>or a controller-writtensha256:<hex>.docs/superpowers/.Context
Platform side (independent repo) shipped two PRs that make this possible:
trakrf/platform#408—docker-build.ymlnow builds thepreviewbranch on everysync-preview.ymlrewrite, publishingghcr.io/trakrf/{backend,ingester}:sha-<short>.trakrf/platform#409— adds a floating:previewtag (priority 50, belowsha-<short>'s 100) specifically so Image Updater'sdigeststrategy has an unambiguous primitive to watch without racing main-branch builds.The hand-off documented in #409 is the exact contract this PR fulfils.
Design highlights
argocdwrite-back, notgitwrite-back. Patches the live Application'sspec.source.helm.parameters. No GitHub credentials to manage. No commit churn onmainevery PR open/sync/close.values-gke.yaml.image.tagstays as the bootstrap value; the live tag lives on the Application.GKE-only gating on the Image Updater Application, env-only gating on the annotations. The Image Updater chart only emits when
cluster=gke. The annotations only emit whenenv=preview AND cluster=gke. When prod shares the GKE cluster post-cutover, prod stays a deliberate manual tag promotion by structure — thetrakrf-backend-prodApplication is structurally unannotated, and Image Updater is opt-in per Application via annotations.Chart-level support for digest references. Image Updater's
digeststrategy writessha256:<hex>into theimage.taghelm parameter. The Docker reference for a digest uses@, not:— so the chart helper detects thesha256:prefix and switches separators. Both deployment and migration job use the helper.See
docs/superpowers/specs/2026-05-25-tra-483-gke-preview-image-updater-design.mdfor the full design walk-through (architecture, sub-decisions, risks).What's NOT in this PR (by design)
trakrf-ingesterruns the upstream Redpanda Connect image; no platform image to track.scripts/apply-root-app.shrun — this is a post-merge manual step (per repo convention).Test plan
Pre-merge (already done, render-only):
helm lint helm/trakrf-backendclean.argocd-image-updaterApplication + 5 annotations ontrakrf-backend-previewonly.argocd-image-updaterApplication, no Image Updater annotations on preview.trakrf-backendtemplate renders<repo>:<tag>forsha-67f3dbcand<repo>@<digest>forsha256:....Post-merge (manual, on GKE):
scripts/apply-root-app.sh gke— re-render with the new templates.kubectl -n argocd get applications—argocd-image-updaterHealthy + Synced.kubectl -n argocd describe app trakrf-backend-preview— annotations present.kubectl -n argocd describe app trakrf-backend-prod— no Image Updater annotations.trakrf/platform; confirm preview env rolls within a few minutes and/version.jsonreports the new commit.🤖 Generated with Claude Code