16

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?

1
  • same question, which should be updated and why? it is very ambigous, there are 3 versions all over the place: chart.version, chart.appVersion and values.item.tag, there are no clear information about them in the documentation
    – Zoltan
    Feb 4, 2020 at 7:52

1 Answer 1

23

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.

1
  • Please remark that this check will fail if you don't have a key "image:" in your values.yaml file, which can be fixed by simply adding an empty one as follows: "image: {}". Jun 1 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.