How to use helm package manager for Kubernetes

Helm is the package manager for Kubernetes, akin to apt on Debian and Ubuntu, or the pip package manager for Python. It allows administrators to install and manage applications in their Kubernetes cluster with ease. In this tutorial, we will explore how to use the Helm package manager for Kubernetes on a Linux system.

In this tutorial you will learn:

  • How to install Helm on Linux
  • How to use Helm with example commands
How to use helm package manager for Kubernetes
How to use helm package manager for Kubernetes
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software Kubernetes, Helm
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Install Helm on Linux




There are multiple ways to install Helm on Linux, such as with Homebrew or Snap:

Homebrew:

$ brew install helm

Snap:

$ sudo snap install helm --classic

Alternatively, you can download the binary from the Helm GitHub page.

How to use Helm with example commands

Helm, like some other package managers, comes with its own jargon that would be very advantageous to learn in order to save you some headaches down the road:

  • Chart = A Helm package
  • Release = An installed package
  • Repository = Where the charts are stored for public download

As an example, if you need to run two Nginx web servers, you can install the Nginx chart two times, which would give you two Nginx releases on your Kubernetes cluster, both with unique names to distinguish them from each other.

Ready to get started using Helm? Here are some example commands:

  1. Use the search argument to search for a matching chart to install. For example, to search for an Nginx chart:
    $ helm search hub nginx
    
    NOTE
    The hub argument above instructs Helm to search the Artifact hub which combines many different repositories.



  2. To add a specific repository to Helm, we use the following syntax:
    $ helm repo add bitnami https://charts.bitnami.com/bitnami
    
  3. We can search the repository we just added for an Nginx chart by using:
    $ helm search repo nginx
    

    The repo argument above will instruct Helm to search all of our configured repositories.

  4. Use the install argument to install a chart:
    $ helm install my-nginx bitnami/nginx
    

    In this command, my-nginx is the name for our release (as it will appear in our Kubernetes cluster), and bitnami/nginx is the repository and chart that we wish to install.

  5. To check the status of your installed release, or to see its configuration settings:
    $ helm status my-nginx
    
  6. Retrieve the latest repository chart information:
    $ helm repo update
    
  7. See all installed releases:
    $ helm list
    

    Or to see all releases including uninstalled ones:

    $ helm list --all
    
  8. Uninstall a release:
    $ helm uninstall my-nginx
    
  9. To see a list of all commands and additional help information:
    $ helm get -h
    

Closing Thoughts




In this tutorial, we saw how to install and use the Helm package manager on a Linux system. This tool goes hand in hand with Kubernetes and streamlines the downloading and deployment of applications onto your Kubernetes cluster. It also has some management tools built in that can be used on top of Kubernetes’ own commands.



Comments and Discussions
Linux Forum