Create Chart Versions


Create Chart Versions

In this tutorial, we are going to discuss about how to create different versions of helm chart and add it as a part of the repository. Let me get into the chart that we had created.

So within our helm chart folder I will be having chart.yaml. I’m going to display the content of the chart.yaml file. Here I do have a field called version.

[email protected]:~/helm_repo_demo/repotest$ cat Chart.yaml 
apiVersion: v2
name: repotest
description: Repo demo in helm using ChartMuseum
type: application
version: 0.1.0
appVersion: "1.16.0"

This version is going to define what version of the chart that we are working on. The same version will get updated within the repository as well.

The version syntax will be followed using the semver.org that is semantic versioning and more details about semantic versioning can be found over here. This is very simple.

Almost all the packages and software’s follow the same logic of major version, minor version and the patch. Now for understanding purpose, I’m going to update the patch from 0 to 1.

[email protected]:~/helm_repo_demo/repotest$ cat Chart.yaml 
apiVersion: v2
name: repotest
description: Repo demo in helm using ChartMuseum
type: application
version: 0.1.1
appVersion: "1.16.0"

There will be another version. This is for the application what version of application getting deployed. Whenever I’m making changes to the application, I will be making the incremental changes to this particular app version. So these are all the mandatory fields.

Now, I am going to update the description as well.

[email protected]:~/helm_repo_demo/repotest$ cat Chart.yaml 
apiVersion: v2
name: repotest
description: Repo demo in helm using ChartMuseum to 0.1.1
type: application
version: 0.1.1
appVersion: "1.16.0"

So that we will have clear information when we are listing that chart versions within the repository. Now I am going to package this particular chart.

[email protected]:~/helm_repo_demo$ helm package repotest
Successfully packaged chart and saved it to: /home/ashok/helm_repo_demo/repotest-0.1.1.tgz

So if I look into the directory it will create another package with the version appended to that particular chart name and this is the latest tar file.

[email protected]:~/helm_repo_demo$ ls
repotest repotest-0.1.0.tgz repotest-0.1.1.tgz

Now, I can add this particular chart file into the repository using curl command.

[email protected]:~/helm_repo_demo$ curl --data-binary "@repotest-0.1.1.tgz" http://192.168.1.50:8080/api/charts
{"saved":true}
Search Repository

Now, let me go ahead and search the repositories. So if I search the repository only the latest version would get listed.

[email protected]:~/helm_repo_demo$ helm search repo mychartmuseumrepo
NAME                            CHART VERSION   APP VERSION     DESCRIPTION                        
mychartmuseumrepo/repotest      0.1.0           1.16.0          Repo demo in helm using ChartMuseum

The latest version is still 0.1.0. Because it’s going to search from the local cache and it needs to update from the server.

Update Repository

Let me go ahead and do an update.

[email protected]:~/helm_repo_demo$ helm repo update
Hang tight while we grab the latest from your chart repositories…
…Successfully got an update from the "mychartmuseumrepo" chart repository
…Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈

So it’s going to connect to the server and check Is there any new charts available And if it is available, it is going to refresh the local repository. Now let me go ahead and search the repository.

[email protected]:~/helm_repo_demo$ helm search repo mychartmuseumrepo
NAME                            CHART VERSION   APP VERSION     DESCRIPTION                        
mychartmuseumrepo/repotest      0.1.1           1.16.0          Repo demo in helm using ChartMuseum to 0.1.1

Here we do have the new version that we had uploaded as a part of the repository and the description also got updated. In case if I wanted more information about this particular chart that is in terms of what are all the list or versions that is the older version as well, the, I can use the option -l.

[email protected]:~/helm_repo_demo$ helm search repo mychartmuseumrepo -l
NAME                            CHART VERSION   APP VERSION     DESCRIPTION                                 
mychartmuseumrepo/repotest      0.1.1           1.16.0          Repo demo in helm using ChartMuseum to 0.1.1
mychartmuseumrepo/repotest      0.1.0           1.16.0          Repo demo in helm using ChartMuseum      

So I do have two versions. The first version is 0.1.0 and the next version is 0.1.1 and I do have the corresponding description as well.

So now it should give better clarity where I can have a repository and I can add more charts into it. Now I can add another chart as well.

Let me go ahead and create a new chart added to it so that we can have much better clarity where the repository can have a collection of charts that we will be doing it in another tutorial where I will create another chart and add it into the repository and verify how a repository can manage multiple charts.

Create Chart Versions


Scroll to top