Helm — K8S Package Manager
What is Helm?
If Kubernetes were an operating system, Helm would be the package manager. Ubuntu uses apt
, CentOS uses yum
, and Kubernetes uses helm
.
Helm is a Kubernetes deployment tool for automating creation, packaging, configuration, and deployment of applications and services to Kubernetes clusters.
Helm Charts help you define, install, and upgrade even the most complex Kubernetes application.
Why Do We Need Helm?
Kubernetes objects are challenging to manage. With helpful tools, the Kubernetes learning curve becomes smooth and manageable. Helm automates maintenance of YAML manifests for Kubernetes objects by packaging information into charts and advertises them to a Kubernetes cluster.
Helm keeps track of the versioned history of every chart installation and change. Rolling back to a previous version or upgrading to a newer version is completed with comprehensible commands.
What Can You Do With Helm?
Helm allows software developers to deploy and test an environment in the simplest possible way. Less time is needed to get from development to testing to production.
Besides boosting productivity, Helm presents a convenient way for developers to pack and send applications to end users for installation.
How Does Helm Work?
Helm and Kubernetes work like a client/server application. The Helm client pushes resources to the Kubernetes cluster. The server-side depends on the version: Helm 2 uses Tiller while Helm 3 got rid of Tiller and entirely relies on the Kubernetes API.
What Is a Helm Chart?
Helm charts are Helm packages consisting of YAML files and templates which convert into Kubernetes manifest files. Charts are reusable by anyone for any environment, which reduces complexity and duplicates. Folders have the following structure:
How Do Helm Charts Work?
The three basic concepts of Helm charts are:
1. Chart — Pre-configured template of Kubernetes resources.
2. Release — A chart deployed to a Kubernetes cluster using Helm.
3. Repository — Publicly available charts.
The workflow is to search through repositories for charts and install them to Kubernetes clusters, creating releases.
Installing Helm
We have to install Helm in client side, most common and preferred way is to install it from binary.
Here you will find the link for downloading the binary of Helm Version 3
https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz
Copy the directory linux-amd64/helm
to /usr/bin
We can check the version of Helm by using the below command :
helm
After setting up K8s Cluster let’s start creating our own custom charts.
Create a separate workspace where we will create Charts.
Configuration file for the chart is Chart.yaml
, we have to create Chart.yaml
and it is compulsory to have capital ‘C’ in Chart.yaml
Content inside Chart.yaml
is as follows :
Now, we can create deployment.yaml
by using the command provided below, in this deployment code we are using the Jenkins image, the yaml code for deployment.yaml
will look like as below :
Now let’s install the helm chart:
Also let’s check whether the pods are running or not ? Also we can check is ‘none’ services running apart from Kubernetes of type Cluster-IP.
Now we will expose the Jenkins server and the service.yaml
:
Checking the launched new services —
Now we can check that our Jenkins server is publicly accessible or not :
http//<Public-IP-Address>:<Exposed-Port>
For getting the password of running Jenkins server, we will do login inside the pod and will view the file that contains the Jenkins server password,
location of the password file is :
/var/jenkins_home/secrets/initialAdminPassword
Now from the above file we can copy the password and paste it in the above displayed page.
Finally, we have successfully deployed Jenkins using Helm chart.
Conclusion
Helm is a significant Kubernetes tool for making deployment a breeze.