How to Install Helm on Kubernetes Cluster?

12 minutes read

To install Helm on a Kubernetes cluster, you can follow these steps:

  1. Start by installing the Helm CLI (Command Line Interface) on your local machine. Depending on your operating system, you can use package managers like Homebrew (for macOS), Chocolatey (for Windows), or apt-get/yum (for Linux) to install Helm.
  2. After installing Helm, initialize Helm on your local machine by running the following command in your terminal: helm init
  3. Once Helm is initialized, it will install Tiller (the server-side component of Helm) into your Kubernetes cluster. Tiller requires certain permissions to operate, so you need to grant these permissions by running the following command: kubectl create serviceaccount --namespace kube-system tiller
  4. Next, give the newly created service account the cluster-admin role by executing the following command: kubectl create clusterrolebinding tiller-cluster-role --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
  5. To ensure the Tiller pod is ready and available, you can run: kubectl rollout status deployment tiller-deploy -n kube-system
  6. After verifying that Tiller is running, you can add some official Helm charts repositories. Helm repositories typically contain charts (pre-packaged applications) that you can install on your cluster. To add the stable charts repository, run the following command: helm repo add stable https://charts.helm.sh/stable
  7. To search for available charts from the repository, you can use the following command: helm search repo stable
  8. Now, you can deploy a chart onto your Kubernetes cluster. For example, to install a chart named "nginx" from the stable repository, you can execute the following command: helm install my-nginx stable/nginx
  9. You can verify the installation by running: kubectl get pods


This installation guide should help you get Helm up and running on your Kubernetes cluster.

Best Kubernetes Books to Read in 2024

1
Kubernetes: Up and Running: Dive into the Future of Infrastructure

Rating is 5 out of 5

Kubernetes: Up and Running: Dive into the Future of Infrastructure

2
Kubernetes in Action

Rating is 4.9 out of 5

Kubernetes in Action

3
The Book of Kubernetes: A Complete Guide to Container Orchestration

Rating is 4.8 out of 5

The Book of Kubernetes: A Complete Guide to Container Orchestration

4
The Kubernetes Operator Framework Book: Overcome complex Kubernetes cluster management challenges with automation toolkits

Rating is 4.7 out of 5

The Kubernetes Operator Framework Book: Overcome complex Kubernetes cluster management challenges with automation toolkits

5
Kubernetes: Up and Running: Dive into the Future of Infrastructure

Rating is 4.6 out of 5

Kubernetes: Up and Running: Dive into the Future of Infrastructure

6
Kubernetes Cookbook

Rating is 4.5 out of 5

Kubernetes Cookbook

7
Mastering Kubernetes - Fourth Edition: Dive into Kubernetes and learn how to create and operate world-class cloud-native systems

Rating is 4.4 out of 5

Mastering Kubernetes - Fourth Edition: Dive into Kubernetes and learn how to create and operate world-class cloud-native systems

8
Mastering Kubernetes: Level up your container orchestration skills with Kubernetes to build, run, secure, and observe large-scale distributed apps, 3rd Edition

Rating is 4.3 out of 5

Mastering Kubernetes: Level up your container orchestration skills with Kubernetes to build, run, secure, and observe large-scale distributed apps, 3rd Edition


What are the prerequisites for installing Helm on Kubernetes?

Before installing Helm on Kubernetes, you must have the following prerequisites:

  1. Kubernetes Cluster: You need to have a Kubernetes cluster up and running. Helm can be used with any Kubernetes cluster, whether it's running locally using minikube or a cloud-based cluster like Google Kubernetes Engine (GKE) or Amazon Elastic Kubernetes Service (EKS).
  2. kubectl: The Kubernetes command-line tool (kubectl) should be installed and configured to communicate with your Kubernetes cluster. Helm interacts with Kubernetes API server through kubectl, so it needs kubectl to be set up properly.
  3. kubectl access to your cluster: Along with having kubectl installed, you need to ensure that it is configured with the authorization credentials to access your Kubernetes cluster. This ensures that Helm can communicate with your cluster and manage resources effectively.
  4. Tiller (deprecated): Older versions of Helm required the Tiller component to be deployed into your cluster. However, as of Helm 3, Tiller has been deprecated and removed. Therefore, if you are installing Helm version 3 or later, you don't need to worry about setting up Tiller. If you are using an older version of Helm, you would need to set up Tiller with appropriate permissions.


Once you have met these prerequisites, you can proceed with installing Helm on Kubernetes.


How to upgrade Helm from version 2 to version 3?

To upgrade Helm from version 2 to version 3, follow these steps:

  1. Backup your Helm 2 configuration: Before upgrading, make sure to take a backup of your existing Helm 2 configuration, including your charts and release data. You can do this by copying the ~/.helm/ directory to a safe location.
  2. Uninstall Helm 2: To ensure a clean transition, uninstall Helm 2 from your system. Depending on your operating system, you can use package managers like apt, brew, or choco to uninstall Helm 2.
  3. Install Helm 3: Install Helm 3 on your system. The installation steps vary depending on your operating system, so make sure to follow the official documentation for your platform.
  4. Migrate Helm 2 releases to Helm 3: Use the Helm 2 to Helm 3 Plugin (helm-2to3) to migrate your Helm 2 releases to Helm 3. Install the plugin by running the following command:
1
helm plugin install https://github.com/helm/helm-2to3.git


After the plugin is installed, run the migration command:

1
helm 2to3 convert


This process will convert your Helm 2 releases to Helm 3 format and store them in the Helm 3 environment.

  1. Test the migration: Verify that your Helm 2 releases have been successfully migrated to Helm 3. You can check this by running helm list and ensure that the migrated releases appear in the list.
  2. Upgrade Helm charts: If you have any Helm charts that were initially built for Helm 2, you may need to update them to be compatible with Helm 3. Review the Helm 2 to 3 migration guide to make any necessary changes to your charts.
  3. Celebrate a successful upgrade: Once you have verified that your Helm 2 releases are functioning correctly in Helm 3, celebrate your successful upgrade!


Keep in mind that Helm 3 introduces several changes and improvements, so make sure to review the official Helm 3 documentation for a complete understanding of the new features and changes before making the upgrade.


What is the difference between Helm 2 and Helm 3?

Helm 2 and Helm 3 are versions of the Helm package manager, used for managing applications deployed on Kubernetes. Here are the key differences between Helm 2 and Helm 3:

  1. Architecture: Helm 2 follows a client-server architecture, where it relies on a server-side component called "Tiller". Helm 3 removes Tiller and becomes a client-side only tool, simplifying the overall architecture.
  2. Security: Helm 2 had some security concerns related to Tiller, as it needed extensive access permissions to the Kubernetes cluster. Helm 3 removes Tiller, addressing those security concerns.
  3. Initialization: Helm 2 required initializing Tiller on the Kubernetes cluster before using it, which involved some additional setup steps. Helm 3 removes the need for initialization, making it easier to get started.
  4. Chart Distribution: Helm 2 used a centralized repository for chart distribution. In Helm 3, charts can be distributed through any HTTP server, eliminating the need for a centralized repository.
  5. Namespace Isolation: Helm 2 had limitations when it came to managing releases in different namespaces. Helm 3 introduces namespace isolation, allowing releases to be easily managed in different namespaces.
  6. Release Management: Helm 2 grouped releases under a "release" namespace, which made it difficult to manage multiple releases of the same chart. Helm 3 provides improved release management, allowing for multiple instances of the same chart with independent lifecycle management.
  7. Chart Dependencies: Helm 2 had complex handling of chart dependencies, where dependencies had to be separately managed and installed. Helm 3 simplifies the dependency management process, making it more streamlined and intuitive.


These are some of the key differences between Helm 2 and Helm 3. Helm 3 offers improved security, streamlined architecture, and enhanced usability compared to Helm 2.


How to set up Helm on a multi-node Kubernetes cluster?

To set up Helm on a multi-node Kubernetes cluster, you can follow these steps:

  1. Set up your multi-node Kubernetes cluster: This can be done using any Kubernetes distribution or cloud provider. Ensure that all nodes are reachable and properly configured.
  2. Install Helm on the cluster: Helm is a client-server architecture, so you need to install both the client-side (Helm CLI) and server-side (Tiller) components. Helm CLI can be installed locally on your computer, while Tiller is installed on your Kubernetes cluster. Install Helm CLI: Download the Helm binary for your operating system from the Helm GitHub repository (https://github.com/helm/helm/releases) and add it to your system's PATH. Install Tiller on the cluster: Tiller is the server component that manages Helm releases. Execute the following commands to install Tiller on your cluster: $ kubectl create serviceaccount --namespace kube-system tiller $ kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller $ helm init --service-account tiller
  3. Verify the installation: Wait until Tiller is running and properly installed. You can check its status by executing kubectl get pods --namespace kube-system.
  4. Configure your Helm environment: Before using Helm, add the necessary Kubernetes cluster configuration to your environment. Execute kubectl config current-context to obtain the name of the current Kubernetes context.
  5. Add a repository: Helm manages packages called charts. Helm repositories provide access to charts. You can add a repository using the helm repo command, such as helm repo add stable https://charts.helm.sh/stable.
  6. Install a chart: Use the Helm CLI to install charts from repositories onto your Kubernetes cluster. For example, you can install the Kubernetes dashboard as a Helm chart by executing helm install stable/kubernetes-dashboard.


Following these steps should allow you to set up Helm on your multi-node Kubernetes cluster, making it easier to manage and deploy applications.

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

Related Posts:

In order to integrate Helm with CI/CD pipelines, there are a few steps involved:Set up and configure Helm: Helm is a package manager for Kubernetes applications. Install Helm on the CI/CD system and configure it to connect with the desired Kubernetes cluster. ...
To package non-Kubernetes resources with Helm charts, you can follow these steps:Understand Helm Charts: Helm is a package manager for Kubernetes that helps you define, install, and manage applications. Helm charts are packages of pre-configured Kubernetes res...
To uninstall Helm from a Kubernetes cluster, you can follow these steps:Open a command-line interface (CLI). Check if Helm is already installed by running the command helm version. If Helm is installed, remove the deployed Helm releases by running the command ...