The Talent500 Blog
Helm Charts - Introduction 1

Helm Charts – Introduction

Helm Charts – Introduction

Introduction 

It’s no secret that Kubernetes is one of the most talked-about technologies of the moment, and that it’s being used by businesses of all sizes. So many Kubernetes objects, including deployment, configmap, secrets, etc., are needed to execute any given application. All of these items must be defined in the manifest.yml file and then sent to the Kubernetes API server. Kubernetes processes these manifest files to produce the requested objects.

Even though a single deployment is OK, repeated deployments require sending all the manifest files to the Kubernetes API server. The tool needed to address this issue is Helm. If Kubernetes were an operating system, Helm would be the package manager. Kubernetes utilises helm, whereas CentOS and Ubuntu both use apt and yum, respectively.

Helm is used to organise charts for the deployment of pre-packaged apps to Kubernetes. The charts compile all the resources for a programme together with its many configurations and versions into one convenient bundle. This blog post will explore installing and deploying Helm for Kubernetes objects.


What is Helm?

Helm is a package management for Kubernetes. When working with numerous microservices at once and needing to follow releases, Helm is a very useful tool. Helm is a templating engine that, when used, generates Kubernetes manifests. These manifests, in turn, allow contemporary applications grow and overcome administrative overload. Therefore, Helm is a Kubernetes deployment tool that automates the process of creating apps and services, as well as packaging them, configuring them, and deploying them to Kubernetes clusters.

When it comes to deploying apps to the platform, problems with package management, security, and configurability might arise. Kubernetes’s package manager, Helm, provides a solution to these problems. When using Helm, installing Kubernetes is significantly simpler than when using other methods.

Why use Helm?

Helm is beneficial in the following ways:

  • Increases overall productivity
  • Decreases the difficulty of deploying microservices 
  • Makes it possible to modify cloud-native apps

Using Helm to deploy software and your own apps to Kubernetes removes a significant amount of the complexity that would otherwise be involved. It can be deployed in a matter of minutes, and once it is, you will be ready to start distributing charts from the stable repository almost immediately. The process of generating your own charts is likewise quite simple, although it does need an awareness of the objects that Kubernetes manages. Your developers will be able to do their jobs more effectively with the help of Helm since it provides them with the tools they need to test their code locally.


After you have installed and configured Helm (details on how to do this are provided below), you will be able to install production-ready applications from software providers, such as MongoDB, MySQL, and others, into your Kubernetes cluster by issuing one extremely easy command called helm install. In addition, uninstalling apps that have been deployed in your cluster is just as simple as adding new ones.

Deploying without Helm in Kubernetes

To deploy to kubernetes involves five basic steps but it vaire application to application, org to org. For simplicity we are considering this.

1. Deployment Scope: Determining what needs to be created. This could be persistent volumes, secrets, configmaps, policies etc. 

  1. Dependencies: Determining what the application depends on. This could be database, redis, or a separate application altogether.
  2. Manifests: Creating manifest by keeping step 1 and step 2 in mind.
  3. Deploy Manifests: Deploying the manifest created in the right order. For example if you cannot create a deployment on a namespace that doesn’t exist. Ideally, first create a namespace and then apply deployment.
  4. Perform Configurations: Logging any application specific configurations.

Helm Charts - Introduction 2

Deploying with Helm in Kubernetes

Deploying to Kubernetes with helm is far more simpler. First. We have an already existing template and charts repository. We only need to declare, a new chart inside the repository for the new services.

  1. Locate a Chart: All the applications have a chart and a new can also be created. Dependencies on different application can be listed as well as all other manifests can be templated.
  2. Deploy the Chart: All the part of the applications or all the microservices can be deployed with a single command.
  3. Perform Configurations: Post installation configurations, like permission, network policy etc. 

 

Installing Helm

Prerequisites: Kubernetes cluster or miikube installed with kubectl commands working. 

Package Manager

Mac:  brew install helm

Manually(Ubuntu)

wget https://get.helm.sh/helm-v3.5.0-linux-amd64.tar.gz

tar -xzf helm-v3.5.0-linux-amd64.tar.gz
ls -l
mv ./linux-amd64/helm /usr/local/bin/


Understanding Helm

Helm has two parts to it: 

  1. The client (CLI), which lives on your local workstation.
  2. The server (Tiller), which lives on the Kubernetes cluster to execute what is needed.

The idea is that you use the CLI to push the resources you need and Tiller will make sure that state is in fact the case by creating/updating/deleting resources from the chart.

 

To fully grasp helm, there are 3 concepts we need to get familiar with:

Chart. A package of pre-configured Kubernetes resources.

Release. A specific instance of a chart which has been deployed to the cluster using Helm.

Repository. A group of published charts which can be made available to others.

Describing a Helm chart

Helm has a certain structure when you create a new chart. To create, run helm create 

Charts

A Chart in a Helm is just a bundled version of your application that can be used inside a Helm. A chart is a collection of files and folders that adhere to a certain criteria in order to describe the resources that are going to be installed into Kubernetes.

Chart.yaml, which is included with a chart, includes information such as the chart’s version, name, and description, among other things. Under the folder labeled “templates” are located all of the Kubernetes manifest files. You have the option of passing the settings together with the Values.yaml file. This file includes settings that may be changed throughout the installation and upgrading processes by the user.

Let’s create a chart with the following command and understand the structure.

helm create dummy-chart

 

Helm Charts - Introduction 3


In addition to that, it built the tests, which will allow you to test the deployments. Under the “templates” folder, you will find a variety of manifest files, including deployment, hpa, and ingress, amongst others.

  1. The chart is being read by Helm.
  2. It does this by reading the configuration settings from the Values.yml file and then writing these values into the manifest files that are generated.
  3. These created manifests are then sent to the Kubernetes API server by Helm. Kubernetes then uses these manifest files to construct the resources that are wanted in the cluster.

Release

A Release is an instance of a chart running in a Kubernetes cluster. One chart can often be installed many times into the same cluster. And each time it is installed, a new release is created. Consider a MySQL chart. If you want two databases running in your cluster, you can install that chart twice. Each one will have its own release, which will in turn have its own release name.

 

Repository

Helm chart repositories are remote servers containing a collection of Kubernetes resource files. Charts are displayed in directory trees and packaged into Helm chart repositories. To deploy applications with Helm, you need to know how to manage repositories.

 

Helm Commands

Installing an App

Install an app:

helm install [app-name] [chart]

Install an app in a specific namespace:

helm install [app-name] [chart] –namespace [namespace]

Override the default values with those specified in a file of your choice:

helm install [app-name] [chart] –values [yaml-file/url]

Run a test installation to validate and verify the chart:

helm install [app-name] –dry-run –debug

Uninstall a release:

helm uninstall [release]

Add, Remove, and Update Repositories

Add a repository from the internet:

helm repo add [repository-name] [url]

Remove a repository from your system:

helm repo remove [repository-name]

Update repositories:

helm repo update

 

List and Search Repositories

List chart repositories:

helm repo list

Generate an index file containing charts found in the current directory:

helm repo index

Search charts for a keyword:

helm search [keyword]

Search repositories for a keyword:

helm search repo [keyword]

Search Helm Hub:

helm search hub [keyword]

 

Release 

List all available releases in the current namespace:

helm list

List all available releases across all namespaces:

helm list –all-namespaces

List all releases in a specific namespace:

helm list –namespace [namespace]

List all releases in a specific output format:

helm list –output [format]

Apply a filter to the list of releases using regular expressions:

helm list –filter ‘[expression]’

See the status of a specific release:

helm status [release]

Display the release history:

helm history [release]

 

Chart Commands

Create a directory containing the common chart files and directories (chart.yaml, values.yaml, charts/ and templates/):

helm create [name]

Package a chart into a chart archive:

helm package [chart-path]

Run tests to examine a chart and identify possible issues:

helm lint [chart]

Inspect a chart and list its contents:

helm show all [chart]

Display the chart’s definition:

helm show chart [chart]

Display the chart’s values:

helm show values [chart]

Download a chart:

helm pull [chart]

Download a chart and extract the archive’s contents into a directory:

helm pull [chart] –untar –untardir [directory]

Display a list of a chart’s dependencies:

helm dependency list [chart]

Conclusion

In this blog post, we go through the fundamentals of helm, the reasons it’s so important right now, and the benefits it may provide to your organisation. In the upcoming article, we’ll go further with helm by creating a sample application. In the meanwhile, make sure helm is running on all of your computers, and start learning the commands. You won’t want to miss the next installment on Helm, so make sure you subscribe.

0
Shubham Singh

Shubham Singh

He is a SDE-2 DevOps Engineer, with demonstrated history in working with scaling startup. A problem solver by mettle, who loves watching anime when he is not working. He is a learner and educator by heart.

Add comment