Skip to content

Lesson 6 of 9 · 26m

Promotion as Versioned Evidence

Promote immutable artifacts through environments using digests, pull requests, generated diffs, and rollback-ready release records.

Promotion is not copying YAML into a folder named prod. It is the controlled movement of evidence: this artifact, built once, scanned once, tested in one environment, is now allowed in the next. If production receives a different image because the tag was rebuilt, or a different manifest because someone hand-edited the overlay, the evidence chain is broken.

Promote digests, not mutable tags

Mutable tags are convenient lies. 1.42.0 should ideally be immutable, but registries and teams often allow overwriting. Digests are verifiable identity:

images:
  - name: ghcr.io/sudosecurityorg/checkout-api
    digest: sha256:4f1e2b93a760d6db2d91cb0e90f0e5cfef6de60f00a53d16f2f6efb1f7642c21

Your build system can resolve tag to digest after pushing:

crane digest ghcr.io/sudosecurityorg/checkout-api:1.42.0

The promotion pull request then changes a digest and perhaps environment-specific metadata. It does not rebuild the artifact. Rebuilding during promotion turns "same binary" into a hopeful statement.

A promotion PR should answer four questions

What artifact is moving?          image digest and build provenance
Where has it already run?         staging deployment, test evidence, soak time
What exactly changes?             rendered manifest diff
How do we reverse it?             previous digest and rollback PR/commit

Automation can generate this, but do not let automation hide it. The reviewer is approving risk, not clicking a ceremonial green button.

GitHub Flow with environment overlays

A simple controlled flow works well:

git checkout -b promote/checkout-api-1.42.0-prod
cp release-staging.yaml release-prod-candidate.yaml
# update only digest and promotion metadata
kustomize build apps/checkout-api/overlays/prod > rendered/prod.yaml
git diff -- rendered/prod.yaml apps/checkout-api/overlays/prod
gh pr create --title "Promote checkout-api 1.42.0 to prod"

After merge, Flux or Argo CD converges production. Do not bypass this with an emergency UI sync unless the incident is genuinely worse than the governance break. If you do bypass it, reconcile Git immediately afterward.

Rollback is promotion in reverse

The safest rollback is another reviewed change to a known prior digest. kubectl rollout undo may recover a ReplicaSet but reintroduce disagreement with Git. Argo CD can sync to an older Git commit, but that creates branch-time confusion if the repository does not move back. Prefer reverting the promotion commit:

git revert <promotion-commit>

That preserves history and makes the rollback auditable. In a true emergency, choose speed, then clean the control plane before calling the incident complete.

Field notes

  • Automated image updates are not promotion unless they carry environment gates and evidence.
  • Do not let CI push directly to main for production promotion if branch protection means humans never review the effective diff.
  • Record application version, manifest commit, and artifact digest in deployment telemetry.
  • A rollback that rolls back the image but not the database migration is not a rollback; it is a new unknown state.
  • Time-in-stage is evidence. Promoting thirty seconds after staging deployment proves almost nothing.

Was this lesson helpful?

Sign in to rate