Home » DevOps » Kubernetes » Introduction to Kubernetes Helm Charts

About Mary Zheng

Avatar photo
Mary has graduated from Mechanical Engineering department at ShangHai JiaoTong University. She also holds a Master degree in Computer Science from Webster University. During her studies she has been involved with a large number of projects ranging from programming and software engineering. She works as a senior Software Engineer in the telecommunications sector where she acts as a leader and works with others to design, implement, and monitor the software solution.

Introduction to Kubernetes Helm Charts

In this article, we explain the basics about Kubernetes Helm Charts.

1. Kubernetes Helm Charts

Kubernetes Helm Chart is a single package that contains the definition of Kubernetes resources and is used to deploy the containerized application with a single helm install or helm upgrade command. In this article, I will explain the basic information that you need to know about the Kubernetes helm charts.

2. Helm Chart Folder Structure

Helm chart has the following folder structure:

mychart/
  Chart.yaml
  values.yaml
  charts/
  templates/
NameDescription
Chart.yamlDefine the chart’s name, type, version, etc.
values.yamlDefine variables used in the templates along with the default value.
chartsInclude the sub-charts definition.
templatesIncludes helm related files: _helpers.tpl and NOTES.txt and Kubernetes definition files: deployment.yaml, service.yaml, ingress.yaml, etc.
Table 1 Helm Chart

3. Helm Chart Templates Folder

The templates folder includes the manifest files for the containerized application. Here are the common ones:

NameDescription
_helpers.tplDefine the common template helpers which can be used in the entire chart.
NOTES.txtDefine the text message displayed at the end of the “helm install” and “helm upgrade” commands.
deployment.yamlThe deployment.yaml for the Kubernetes cluster utilized variables defined in values.yaml.
service.yamlThe service.yaml for the Kubernetes cluster utilized variables defined in values.yaml.
ingress.yamlThe ingress.yaml for the Kubernetes cluster utilized variables defined in values.yaml.
Table 2 templates

In this step, I will define the replicaCount variable with the default value of 1 in the values.yaml file.

values.yaml

replicaCount: 1

I then can reference the replicaCount variable in the deployment.yaml as {{ .Values.replicaCount }}.

deployment.yaml

spec:
  replicas: {{ .Values.replicaCount }}

When helm install command is executed, it will replace the {{ .Values.replicaCount }} with 1.

4. Helm Commands

Helm is the package manager for Kubernetes. The most recently 3.7.1 version is released in October 2021.

4.1 Helm install

Here is the syntax of the helm install command.

helm install [NAME] [CHART] [flags]

It will deploy the packaged application in Kubernetes after replacing the variables defined in the manifest files in the templates folder.

4.2 Helm upgrade

Here is the syntax for the helm upgrade command.

helm upgrade [RELEASE] [CHART] [flags]

According to the best practice article, it’s better to use the helm upgrade –install than the helm install command.

5. Helm Hub & Versions

Most corporates host their internal chart repositories. Artifact Hub lists thousands of Helm charts from numerous public repositories. Please also reference this site to find the matching Helm and Kubernetes version.

6. References

Here are a few easy to follow introduction resources:

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

6. Spring Interview Questions

7. Android UI Design

 

and many more ....

 

Receive Java & Developer job alerts in your Area

I have read and agree to the terms & conditions

 

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments