Helm is commonly referred to as Kubernetes’ package manager. Although it appears to be a basic package manager, it has more capabilities. Helm is a fully accessible project that was originally developed by DeisLabs and is now maintained by CNCF. Helm was created to give users the best way to handle all of the Kubernetes YAML files they build on Kubernetes projects.

Helm Charts are a set of Kubernetes YAML artifacts that can be distributed to your Kubernetes clusters as a single package. It also maintains a version history with all released maps allowing you to revert to an old iteration if anything unexpected happens. This chart comes with native Kubernetes assistance so you won’t have to write any complicated syntax files or something to get started with Helm. Simply drag your design files into a new chart and you are done.

This step-by-step guide walks you through the process of creating and deploying a Helm chart in Kubernetes.

Pre-Requisites

To make a Kubernetes helm chart on Ubuntu 20.04 LTS, make sure you have installed and configured minikube in your system. You must have sudo privileges for the implementation of this detailed article.

Steps to Create Helm Chart

To create a helm chart in Ubuntu 20.04, initially, you have to open the command line terminal. You can complete this task by navigating through applications or by simply using the shortcut key of Ctrl Alt T.

As soon as your terminal window is popped up, you have to execute the following written command in your terminal to install Helm on your system.

$ Sudo snap install helm –classic

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-488.png" data-lazy- height="59" src="data:image/svg xml,” width=”718″>

As you can see from the above-attached screenshot, that helm is already installed in our system. If it is not present, the installation will begin after the execution of the above-cited command.

To verify the installation of the helm, you can use the following listed command. The output will return a path to the helm.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-489.png" data-lazy- height="40" src="data:image/svg xml,” width=”720″>

Now, this is the time to create a helm chart. For this purpose, you have to execute the listed command in your terminal.

Note: You can replace “linuxhint” with any of your desired names. From the output displayed below, you can see that the chart has been created. If you want to view the structure of your created helm chart, you can execute the below-listed command.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-490.png" data-lazy- height="70" src="data:image/svg xml,” width=”724″>

The created chart directory includes charts, chart.yaml, templates, and values.yaml files.

Now you have to make little amendments to the values.yaml file. To view values.yaml file, you have to navigate through the files directory and open this file in any text editor.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-492.png" data-lazy- height="239" src="data:image/svg xml,” width=”729″>

As soon as you open values.yaml file, you have to locate the below-shown image values in the file. You can currently see that the value of pullPolicy is “IfNotPresent”.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-494.png" data-lazy- height="215" src="data:image/svg xml,” width=”718″>

You have to update the value of pullPolicy as “Always”. The updates are shown in the below-cited image. You can also see that we have updated the following fields as:

nameOverride: “linuxhint-app”

fullnameOverride: “linuxhint-chart”

Do remember that these changes will help you in the creation of your desired helm chart.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-495.png" data-lazy- height="271" src="data:image/svg xml,” width=”715″>

Currently, in the service account field, you can see that the “name” has no value in it.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-497.png" data-lazy- height="178" src="data:image/svg xml,” width=”713″>

You have to add your required name in this field. In our scenario, we have updated this field as:

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-499.png" data-lazy- height="165" src="data:image/svg xml,” width=”718″>

When you operate the cluster, the service account name for the Helm chart is created. However, a manual setting is a good idea. The service account name ensures that the program is specifically linked to a relevant chart-controlled user. It is empty by default, but you can set it as per your desire.

Now, it is time to modify the networking service type. Initially, it is as follows:

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-501.png" data-lazy- height="70" src="data:image/svg xml,” width=”718″>

It is recommended to use NodePort. So, we have replaced “ClusterIP” with “NodePort” as shown in the attached snapshot.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-502.png" data-lazy- height="67" src="data:image/svg xml,” width=”720″>

After updating all fields in the values.yaml file. You have to save all changes and close.

Deployment of Helm Chart

The deployment of the helm chart can be done by the implementation of the appended steps mentioned in this guide. Initially, you have to install the already created helm chart. For this purpose, you have to write the following command in your Ubuntu 20.04 LTS terminal:

$ helm install linuxhint-chart linuxhint/ –values linuxhint/values.yaml

You can add the full name override and chart name the same as you have mentioned in your values.yaml file. In the output of this command, you can see that the application has been deployed successfully.

In the attached image, you can see “Get the application URL by executing these commands”.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-503.png" data-lazy- height="254" src="data:image/svg xml,” width=”734″>

So, to get the pod Node Port, you have to run the first export command mentioned in the above image. There will be no output upon the execution of this command.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-504.png" data-lazy- height="36" src="data:image/svg xml,” width=”726″>

Now, to get the pod Node Port again, you have to run the second export command mentioned in the above image. Again, there will be no output upon the execution of this command.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-505.png" data-lazy- height="35" src="data:image/svg xml,” width=”726″>

The echo command was also displayed. For the installation of the helm chart, you just need to copy that command and execute it.

$ Echo http://$NODE_IP:$NODE_PORT

This command will return the IP address and port number.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-506.png" data-lazy- height="39" src="data:image/svg xml,” width=”727″>

Now, you have to copy the displayed IP address and port number and write it into your favorite browser. You can view that the application has been successfully deployed.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/05/echo/word-image-507.png" data-lazy- height="484" src="data:image/svg xml,” width=”731″>

Conclusion

In this guide, we have explained to you the usage of the helm chart in Kubernetes along with the creation of the helm chart, its installation, and deployment. I believe, after following every step, you can easily create your helm chart.

About the author

<img alt="" data-lazy-src="https://secure.gravatar.com/avatar/d014e3711df41253029f4d4199698df8?s=112&r=g" data-lazy- height="112" src="data:image/svg xml,” width=”112″>

Kalsoom Akhtar

Hello, I am a freelance writer and usually write for Linux and other technology related content