Using Helm with Kubernetes

Using Helm with Kubernetes

Helm is an open-source package manager for Kubernetes. Helm manages Kubernetes application through a component called Tiller Server installed within a Kubernates cluster. Helm Client: Helm provides a command-line interface for users to work with Helm Charts.

Kubernetes is a powerful orchestration system, however, it can be really hard to configure its deployment process. Specific apps can help you manage multiple independent resources like pods, services, deployments, and replica sets. Yet, each must be described in the YAML manifest file.

It’s not a problem for a single trivial app, but during production, it’s best to simplify this process: search, use, and share already implemented configurations, deploy these configurations, create configuration templates, and deploy them without effort. In other words, we need an extended version of a package manager like APT for Ubuntu or PIP for Python to work with the Kubernetes cluster. Luckily, we have Helm as a package manager.

What is Helm?

Helm is an open-source package manager for Kubernetes that allows developers and operators to package, configure, and deploy applications and services onto Kubernetes clusters easily. It was inspired by Homebrew for macOS and now is a part of the Cloud Native Computing Foundation.

In this article, we will explore Helm 3.x which is the newest version at the time of writing this article.

Searches on Helm Hub for PostgreSQL from dozens of different repositories

Helm can install software and dependencies, upgrade software, configure software deployments, fetch packages from repositories, alongside managing repositories.

Some key features of Helm include:

  • Role-based access controls (RBAC)
  • Golang templates which allows you to work with configuration as text
  • Lua scripts to process configuration as an object
  • Deployment versions control system

Templates allow you to configure your deployments by changing few variable values without changing the template directly. Helm packages are called charts, and they consist of a few YAML configuration files and templates that are rendered into Kubernetes manifest files.

The basic package (chart) structure:

  • chart.yaml - a YAML file containing information about the chart
  • LICENSE (optional) - a plain text file containing the license for the chart
  • README.md (optional) - a human-readable README file
  • values.yaml - the default configuration values for this chart
  • values.schema.json (optional) - a JSON Schema for imposing a structure on the values.yaml file
  • charts/ - defines chart dependencies (recommended to use the dependencies section in chart.yaml)
  • crds/ - Custom Resource Definitions
  • templates/ - directory of templates that when combined with values, will generate valid Kubernetes manifest files

Templates give you a wide range of capabilities. You can use variables from context, apply different functions (such as ‘quote’, sha256sum), use cycles and conditional cases, and import other files (also other templates or partials).

What are Helm’s abilities?

  1. As you operate Helm though a Command Line Interface (CLI), the helm search command allows you to search for a package by keywords from the repositories.
  2. You can inspect chart.yaml, values.yaml, and README.md for a certain package. along with creating your own chart with the helm create <chart-name> command. This command will generate a folder with a specified name in which you can find the mentioned structure.
  3. Helm can install both folder or .tgz archives. To create a .tgz from your package folder, use the helm package <path to folder> command. This will create a <package_name> package in your working directory, using the name and version from the metadata defined in the chart.yaml file.
  4. Helm has built-in support for installing packages from an HTTP server. Helm reads a repository index hosted on the server, which describes what chart packages are available and where they are located. This is how the default stable repository works.
  5. You can also create a repository from your machine with helm serve. This eventually lets you create your own corporate repository or contribute to the official stable one.
  6. You can also call the helm dependencies update <package name> command which verifies that the required charts, as expressed in chart.yaml, are present in charts/ and are in an acceptable version. It will additionally pull down the latest charts that satisfy the dependencies, and clean up the old dependencies.
  7. Apart from Chart and Repository another significant concept you should know is Release which 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. So, you can have multiple PostgreSQL in the same cluster, in which each Release will have its own release name. You can think of this like 'multiple Docker containers from one image'.

kubernetes devops

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

50+ Useful Kubernetes Tools for 2020 - Part 2

Our original Kubernetes tool list was so popular that we've curated another great list of tools to help you improve your functionality with the platform.

How to Extend your DevOps Strategy For Success in the Cloud?

DevOps and Cloud computing are joined at the hip, now that fact is well appreciated by the organizations that engaged in SaaS cloud and developed applications in the Cloud. During the COVID crisis period, most of the organizations have started using cloud computing services and implementing a cloud-first strategy to establish their remote operations. Similarly, the extended DevOps strategy will make the development process more agile with automated test cases.

What Is DevOps and Is Enterprise DevOps Any Good?

What is DevOps? How are organizations transitioning to DevOps? Is it possible for organizations to shift to enterprise DevOps? Read more to find out!

DevOps Basics: What You Should Know

What is DevOps? What are the goals it helps achieves? What are its benefits? This article has answers!

Why You Should Be Adopting a DevOps Culture in 2020 - DZone DevOps

The year 2020 has arrived, and its arrival brings a lot of innovations and transformations in the Information and Technology (IT) sector to DevOps technologies.