Q: What is artifact management and why do you need it?
Artifact management is the practice of storing, versioning, securing and promoting the outputs of your build, such as container images, packages, Helm charts and binaries, in a dedicated repository instead of rebuilding them.
Want to master this scenario in a live sandbox? KodeKloud's Enterprise GitOps with ArgoCD & Kubernetes Rollouts covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: <strong>Artifact management</strong> is the practice of storing, versioning, securing and promoting the outputs of your build, such as container images, packages, Helm charts and binaries, in a dedicated repository instead of rebuilding them. You need it so that what you tested is exactly what you deploy, so you can roll back to a known version, and so you can trace a running service back to a commit. Interviewers ask to confirm you understand build-once-promote-many, immutability and supply chain controls, not just where files are stored.
Mental model: build once, store immutably, promote
An artifact is a build output with an identity; a repository is its system of record.
- Artifact types: Container images (registry), language packages (npm, PyPI, Maven), Helm charts (OCI registry), and installers or binaries.
- Immutability: A version, once published, never changes. This is what makes deployments reproducible and rollbacks trustworthy.
- Promotion, not rebuild: The same digest moves from dev to staging to prod by retagging or copying. Rebuilding for production means you ship something you never tested.
- Metadata: Store commit SHA, build ID, SBOM and provenance with the artifact so it is traceable.
- Why it matters: Without a repository, teams rebuild from source, pick up different dependency versions, and cannot prove which binary is in production during an audit or incident.
Hands-on: artifact management with a registry
Publish an immutable image, sign it, and promote it by digest.
aws ecr put-image-tag-mutability --repository-name my-app \
--image-tag-mutability IMMUTABLE
docker build -t 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app:${GIT_SHA} .
docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app:${GIT_SHA}
cosign sign --yes 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app@sha256:<digest>
# Promote the same digest to a prod repository
crane copy 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app@sha256:<digest> \
123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app-prod:1.4.2
- Immutable tags: For ECR use
aws ecr put-image-tag-mutability --image-tag-mutability IMMUTABLE. - Push with a unique tag: Tag with the commit SHA so every build has a distinct identity.
- Sign:
cosign sign --yes <image>@<digest>attaches a signature, with keyless signing available when your CI provides OIDC identity. - Promote:
crane copycopies by digest between repositories without pulling to the runner. - Authentication: Log in with short-lived credentials, for example
aws ecr get-login-password | docker login --username AWS --password-stdin <registry>, rather than static passwords. Inspect what you published:docker buildx imagetools inspect <image>:<tag>prints the manifest digest and platforms, which is the value to record in deployment manifests.
CI job artifacts versus release artifacts
Use the right store for the right lifetime.
- uses: actions/upload-artifact@v4
with:
name: test-report-${{ github.run_id }}
path: reports/
retention-days: 14
- Job artifacts:
actions/upload-artifact@v4and GitLabartifacts:pass files between jobs and expire by retention settings. They are for test reports and intermediate builds. - Release artifacts: Push to a registry or package repository (ECR, GHCR, Artifactory, Nexus) with retention measured in releases, not days.
- Caches: Dependency caches speed builds but are not artifacts; they can be evicted at any time and must never be a source of truth.
- Retention policy: Keep every released version and the last N untagged builds; never delete an image that a cluster still references.
- Naming: Include the run ID or commit SHA in job artifact names so parallel matrix jobs do not collide. Language packages: Proxy public registries like npm and PyPI through an internal repository so builds keep working during upstream outages and so you can block bad versions.
Failure modes and edge cases
Problems appear when artifacts are mutable, unscanned or pruned too early.
- Mutable tags: Overwriting
latestor a version tag makes two nodes run different code under the same name. - Over-aggressive cleanup: Lifecycle rules that delete by age can remove the image you need for rollback. Exempt tags matching release patterns.
- Registry as single point of failure: A registry outage blocks scale-up and deploys; consider pull-through caches or replication.
- Credentials sprawl: Long-lived registry passwords in CI leak easily; use OIDC and short-lived tokens.
- Compliance: Retain release artifacts for as long as audit rules require, and document where they live and who can delete them.
Production practice: provenance and security
Make artifacts verifiable.
- SBOM and provenance: Generate an SBOM and build attestations in CI and attach them to the image so audits can see contents.
- Scan on publish and on schedule: New vulnerabilities appear after release, so rescan stored images regularly.
- Admission policy: Enforce signature verification in the cluster (for example with Kyverno or Sigstore policy controller).
- Access control: CI gets push rights; clusters get pull-only roles; humans rarely get either.
- Lifecycle policies: In ECR,
aws ecr put-lifecycle-policywith a JSON policy can expire untagged images while keeping tagged release images; test the policy preview before applying. Disaster recovery: Replicate critical repositories to a second region or registry and test pulling from it, so a regional outage does not stop deployments.
- Artifact management stores, versions, secures and promotes build outputs in a repository so you deploy exactly what you tested.
- I verify by digest, signature and SBOM, and I trace each running image back to a commit.
- I automate immutable tags, signing in CI, retention policies that protect released versions, and cluster-side signature enforcement.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Rebuilding the image for production The production image differs from the tested one, which breaks the guarantee of testing.
- Using mutable latest as a deploy reference You cannot tell what is running or roll back to what ran yesterday.
- Retention policy that prunes by age only It can delete a release image still referenced by a cluster, causing ImagePullBackOff on scale-up.
- Treating the dependency cache as storage Caches can be evicted anytime, so builds become non-reproducible.