INFRA-DEVOPS Contents

Artifact Immutability and Promotion

Make artifacts immutable and promote by digest across environments to eliminate “works in staging” drift.

On this page

Artifact Immutability & Promotion

  • Build once, promote everywhere: same digest moves across envs.
  • Tags are pointers; digests are identity.
  • Immutability reduces drift and rollback ambiguity.

Promotion Model

  1. CI produces artifact digest.
  2. Staging deploy uses digest.
  3. After verification, promote digest to prod.
  4. Rollback is selecting a previous known-good digest.

Ops Commands

# See current rollout images (digest or tag)
kubectl -n app get deploy api -o jsonpath='{$.spec.template.spec.containers[*].image}'

# Rollback to previous revision
kubectl -n app rollout undo deploy/api

Failure Modes

  • Rebuilding the “same” version: digest differs, behavior differs.
  • Mutable tags in prod: investigation becomes guesswork.