When creating a new Helm chart via helm create chart
, Helm will create an appVersion
field in Chart.yaml
and an image.tag
field in values.yaml
.
For debugging purposes, it's convenient to set image.tag
on deployment instead of having to create a new chart. Otherwise, however, I keep them in sync because I want to see the true version of the Docker image when looking at the output of helm list
.
Despite for debugging, is there a reason to use {{ .Values.image.tag }}
instead of {{ .Chart.AppVersion }}
in the deployment file?
If for your version control needs they are the same, then it doesn't matter.
Some even recommend as best practice to use
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
However consider often {{ .Values.image.tag }}
and {{ .Chart.AppVersion }}
may use different version.
{{ .Values.image.tag }}
- Docker image tag.
{{ .Chart.AppVersion }}
- Version of the app that is inside the image - you may be developing an app that you version control separately from your image.
{{ .Chart.version }}
- If you are developing the Chart you need to version control it. Each change to the template should result version increase. Helm documentation says:
Every chart must have a version number. A version must follow the SemVer 2 standard. Unlike Helm Classic, Kubernetes Helm uses version numbers as release markers. Packages in repositories are identified by name plus version.