WORK SMARTER, NOT HARDER
Are you tired of writing and maintaining K8s YAML manifests for all the required Kubernetes object? Or do you feel drowsy for even the simplest of deployments by writing at least 3 YAML manifests with duplicated and hardcoded values?
So don’t worry. Here we are to make your time productive and simplifying the process.
Prerequisites: Understanding of Kubernetes
What will you GET ??
In this post, we are going to discuss a tool that is used with Kubernetes called Helm. This article will help you:
- Explore Helm and Helm Charts
- Determine when and why to use Helm and Helm Charts
- Know the benefits of using Helm
What is Helm and Helm Chart??
Helm is a package manager for Kubernetes. Much like apt and yum for Linux distributions, it helps in deploying charts. Charts are more or less like packaged applications ready to be installed. They are a collection of all our versioned, pre-configured application resources/manifests that can be deployed as one unit.
Helm helps in three key ways:
- Boosts productivity
- Reduces duplication & complexity of deployments of microservices
- Enables the adaptation of cloud-native applications
Helm Components :
Helm is an executable that is implemented into two distinct parts:
- Helm Client
- Helm Library
Before diving directly into these components let’s get clear with some of Helm terminologies :
- Helm Charts: Helm Packages are called charts, it usually consists of a few YAML configuration files and some templates that are rendered into Kubernetes manifest files. Helm charts are used to deploy an application or one component of a larger application.
- Helm Chart Repo: A chart repository is a public repository that consists of packaged charts of applications. We can also configure or make our own repository as well and publish it.
- Helm Releases: During the installation of a chart, Helm combines the templates of the charts with the configuration specified by the user. These are rendered into Kubernetes manifests that are then deployed via the Kubernetes API. This creates a release, a specific configuration, and deployment of a particular chart.
The Helm Client is a command-line client for end users. The client is responsible for the following:
- Local chart development: Can create our own local charts for our application.
- Managing repositories: Can add and even create own chart repositories.
- Managing releases: Can manage releases that help us in a rollback to previous version releases when required.
- 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.
Why use Helm and Helm Charts?
Writing and maintaining Kubernetes YAML manifests for all the required deployments and even maintaining the dependencies for all those applications can be a time consuming and tedious task. And when we know that most of the software components follow the standard deployment resources. Don’t you think instead of writing on its own there should be something more generic published somewhere publicly and can be used by anyone?
Helm simplifies this process and creates a single package that can be deployed to your K8s cluster. Helm providing a convenient way for engineers to package and ship an application and its dependencies to their end-users to install.
Once we have Helm installed and configured (link to install), we’ll be able to install deployment-ready applications of software vendors, such as MySQL, Redis, Prometheus, Grafana, and others into our Kubernetes cluster with one very simple helm install command. Additionally, removing installed applications in your cluster is as easy as installing them.
Benefits of Helm
- Boosts productivity: Using Helm allows the software to deploy their different environments at the click of a button.
An example of this might be: in order to test a new upcoming feature, an engineer needs a Postgres database. Instead of going through the process of installing the software manually, creating the databases and tables required, the engineer can simply run a single Helm Install command to create and prepare the database ready for testing.
- Reduces duplication & complexity: Once the chart is built, it can be used over and over again and by anyone. The fact that we can use the same chart for any environment reduces the complexity of creating something for dev, test, and prod. We can simply tune our chart and make sure it is ready to apply to any environment.
- Adaptation of cloud-native applications: As the term, itself describes, collection of small, independent, and loosely coupled services. As modern applications and Kubernetes objects might be dependent on other applications and other Kubernetes objects, Helm helps in resolving those dependencies.
Don’t worry we won’t end here. Keep reading the coming blog which will help you get started with Helm, Helm Charts, Helm Repositories, and configuring them in your local system.
This blog might not be something unique, but it’s our practice to give a short and crisp explanation that can help everyone acquire and implement basics at their level. How do you feel please share your feedback in the comment box.
HAPPY HELMING 🙂
Blog Pundit: Adeel Ahmad
Opstree is an End to End DevOps solution provider