Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

image.tag (in values.yaml) vs. appVersion (in Chart.yaml)

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?

like image 265
Tobias Uhmann Avatar asked Sep 23 '19 15:09

Tobias Uhmann


People also ask

What is AppVersion in chart yaml?

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.

What is chart yaml in Helm?

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 .

What is Helmchart?

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.


1 Answers

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.

like image 62
Filip Nikolov Avatar answered Oct 22 '22 06:10

Filip Nikolov