Helm— K8S Package Manager
What Is Helm ???
Helm helps you manage Kubernetes applications — Helm Charts help you define, install, and upgrade even the most complex Kubernetes application.
Helm is a tool for managing Kubernetes packages called charts. Helm can do the following :
- Create new charts from scratch
- Package charts into chart archive (tgz) files
- Interact with chart repositories where charts are stored
- Install and uninstall charts into an existing Kubernetes cluster
- Manage the release cycle of charts that have been installed with Helm
For Helm, there are three important concepts:
- The chart is a bundle of information necessary to create an instance of a Kubernetes application.
- The config contains configuration information that can be merged into a packaged chart to create a releasable object.
- A release is a running instance of a chart, combined with a specific config.
Helm is an executable which is implemented into two distinct parts:
The Helm Client is a command-line client for end users, it is responsible for the following:
- Local chart development
- Managing repositories
- Managing releases
- Interfacing with the Helm library — Sending charts to be installed & Requesting upgrading or uninstalling of existing releases
The Helm Library provides the logic for executing all Helm operations. It interfaces with the Kubernetes API server and provides the following capability:
- Combining a chart and configuration to build a release
- Installing charts into Kubernetes, and providing the subsequent release object
- Upgrading and uninstalling charts by interacting with Kubernetes
The standalone Helm library encapsulates the Helm logic so that it can be leveraged by different clients.
The Helm client and library is written in the Go programming language.
The library uses the Kubernetes client library to communicate with Kubernetes. Currently, that library uses REST+JSON. It stores information in Secrets located inside of Kubernetes. It does not need its own database.
Configuration files are, when possible, written in YAML.
Helm uses a packaging format called charts. A chart is a collection of files that describe a related set of Kubernetes resources. A single chart might be used to deploy something simple, like a memcached pod, or something complex, like a full web app stack with HTTP servers, databases, caches, and so on.
Charts are created as files laid out in a particular directory tree. They can be packaged into versioned archives to be deployed.
If you want to download and look at the files for a published chart, without installing it, you can do so with
helm pull chartrepo/chartname.
The Chart File Structure
A chart is organized as a collection of files inside of a directory. The directory name is the name of the chart (without versioning information). Thus, a chart describing WordPress would be stored in a
Documentation Link for your reference :
Creating our own custom chart —
- We’ll use AWS Cloud for setting up Kubernetes Master and Kubernetes Slave.
- You can refer one of my blog for your reference —
- Here, we will integrate Helm & Jenkins.
- 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
- Copy the directory linux-amd64/helm to /usr/bin/
- We can check the version of Helm by using the below command —
- After setting up K8s Cluster let’s start creating our own custom charts, create a workspace where we will create Charts.
- Configuration file for the chart is “ Chart.yaml ” , we have to create Chart.yaml & it is compulsory to have capital ‘C’ in Chart.yaml.
- Content inside Chart.yaml is as follows —
- Now in next 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 —
- 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 —
- 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.
- Thank you for reading & learning with me.