How do you keep image tags out of values files when CI builds images?
IntermediateConceptValues & Precedence
Answer
Two common patterns:
- CI passes the tag at deploy time:
--set-string api.image.tag=$GIT_SHA. Simple, but the deployed tag is not in Git. - GitOps: CI commits the new tag into
values-prod.yaml(or Argo CD Image Updater does), so Git is the source of truth and rollback is agit revert.
Alternatively, package the chart with --app-version $VERSION and let templates default the tag to .Chart.AppVersion, so the chart version itself pins the image.
More on Values & Precedence
What is the precedence order of values in Helm?BeginnerHow are lists merged across values files?IntermediateWhat is the difference between `--set` and `--set-string`?BeginnerHow do you set nested keys, list items and keys containing dots with `--set`?IntermediateWhat are `--set-file`, `--set-json` and `--set-literal` for?IntermediateHow do you remove a default value set in a chart's `values.yaml`?Intermediate