Helm— K8S Package Manager

Source : Owner

What Is Helm ???

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:

  1. The chart is a bundle of information necessary to create an instance of a Kubernetes application.
  2. The config contains configuration information that can be merged into a packaged chart to create a releasable object.
  3. A release is a running instance of a chart, combined with a specific config.

Components

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.

Implementation

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.

Charts

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

Documentation Link for your reference :

https://helm.sh/docs/

Creating our own custom chart —

  • You can refer one of my blog for your reference —

https://medium.com/@hardiktilwani4/configuration-of-multi-node-k8s-cluster-over-aws-using-ansible-b6a04bb91184

  • Here, we will integrate Helm & Jenkins.
Source : Owner

Installing Helm

  • Copy the directory linux-amd64/helm to /usr/bin/
  • We can check the version of Helm by using the below command —
helm version
  • 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 —

http//PublicIPAddress:ExposedPort

  • 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.
  • Thank you for reading & learning with me.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store