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?
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.
yaml is used by many of the Helm tools, including the CLI. When generating a package, the helm package command will use the version that it finds in the Chart. yaml as a token in the package name. The system assumes that the version number in the chart package name matches the version number in the Chart. yaml .
Helm Charts are simply Kubernetes YAML manifests combined into a single package that can be advertised to your Kubernetes clusters. Once packaged, installing a Helm Chart into your cluster is as easy as running a single helm install, which really simplifies the deployment of containerized applications.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With