Create Chart Versions


Create Chart Versions

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

Create Chart Versions

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

ashok@waytoeasylearn:~/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 semver.org to find semantic versioning and more details about semantic versioning. This is very simple.

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

ashok@waytoeasylearn:~/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 make incremental changes to this particular app version. So these are all the mandatory fields.

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

ashok@waytoeasylearn:~/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 will package this particular chart.

ashok@waytoeasylearn:~/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, which is the latest tar file.

ashok@waytoeasylearn:~/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 the curl command.

ashok@waytoeasylearn:~/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.

ashok@waytoeasylearn:~/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, it needs to update from the server.

Update Repository

Let me go ahead and do an update.

ashok@waytoeasylearn:~/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 If there are any new charts available And if it is available, it will refresh the local repository. Now let me go ahead and search the repository.

ashok@waytoeasylearn:~/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 have the new version that we had uploaded as a part of the repository, and the description also got updated. If I wanted more information about this particular chart, that is in terms of all the list of versions that is the older version as well, the, I can use the option -l.

ashok@waytoeasylearn:~/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 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