Best of Linux

How to Add, Update, or Remove Helm Repositories

Helm is the Kubernetes package manager which has become an indispensable tool for managing and deploying the applications in the cloud-native ecosystem. Helm’s capacity to interface with repositories, which are collections of charts that provide pre-configured applications or services, is one of its core features. Helm repositories improve the process of administering the applications on Kubernetes clusters by allowing the users to easily discover, install, update, and remove charts.

We will look at how to install, edit, and remove the Helm repositories, allowing us to take advantage of the large array of charts available in the Helm ecosystem. Understanding the repository management approaches will considerably improve our ability to work with Helm.

Install Helm on Linux using the following command:

Type the “wget” command to download and install Helm on your system.

$ wget https://get.helm.sh/helm-v3.9.3-linux-amd64.tar.gz

Then, using the Linux tar program, unpack the Helm file:

$ tar xvf helm-v3.9.3-linux-amd64.tar.gz

Output:

linux-amd64/

linux-amd64/helm

linux-amd64/LICENSE

linux-amd64/README.md

Transfer the “linux-amd64/helm” file to “/usr/local/bin”:

$ sudo mv linux-amd64/helm /usr/local/bin

Run the following command to delete the “linux-amd64” directory and free up some space:

$ rm -rf linux-amd64

Finally, check the program version to ensure that we successfully installed Helm.

Output:

$ helm version

$ helm version

version.BuildInfo{Version:"v3.9.3", GitCommit:"414ff28d4029ae8c8b05d62aa06c7fe3dee2bc58", GitTreeState:"clean", GoVersion:"go1.17.13"}

How to Add the Helm Repositories

We must first add the Helm repositories to our Helm environment before using them. Helm allows us to add both the official Helm team repositories and custom repositories that are generated by individuals or organizations. Adding a repository entails supplying the repository’s URL and giving it a unique name. Let us see the following syntax:

helm repo add <repository-name> <repository-url> <repository-flages>
  • ‘<repository-name>’: This is a placeholder for the name that we want to give to the repository. It is a user-defined name and can be anything we choose. The repository can be located using it.
  • ‘<repository-url>’: This is the URL of the repository. It should point to the repository’s “index.yaml” file which contains information about the accessible charts in the repository. The URL can be an HTTP/HTTPS URL or a path to a local file.
  • ‘<repository-flags> (optional)’: This section allows us to add additional repository flags or settings. Flags affect the Helm repository’s behavior. Some commonly used flags are:
  1. ‘username and –password’: When the repository requires authentication, add the username and password with these flags.
  2. ‘ca-file’: If the repository is secured with a custom certificate authority (CA), we can specify the CA file with this flag.
  3. ‘cert-file and key-file’: If the repository requires client-side certificates for authentication, we can supply the certificate and key files with these flags.

How to Update the Helm Repositories in Linux

It is critical to keep the Helm repositories up-to-date in order to have access to the most recent versions of charts and their dependencies. Fortunately, Helm provides a simple way for updating the repositories and synchronizing them with the most recent available charts.

$ helm repo update

Output:

$ helm repo update

Hang tight while we grab the latest from your chart repositories...

This tool retrieves the most up-to-date repository information for all repositories in our Helm environment, including modifications to charts and new additions. It is advised that we run this command on a regular basis to keep up with the Helm ecosystem’s evolution.

If we need to update a specific repository, use the following command:

helm repo update <repository-name>

For example, to update the stable repository, we should type the following:

$ helm repo update stable

This command fetches the latest information specifically for the mentioned repository.

How to Remove the Helm Repositories in Linux

There may be times when we no longer require access to a specific repository. To reduce the clutter and potential confusion, delete the repository from our Helm environment in such circumstances.

The following is the usual syntax to uninstall the Helm repositories:

helm repo remove [REPO1 [REPO2 ...]] [flags]

Enter this command to remove a Helm repository:

$ helm repo remove stable

Output:

$ helm repo remove stable

"stable" has been removed from your repositories

Conclusion

Helm repositories are indispensable for accessing and utilizing the vast chart ecosystem provided by the Helm community. Adding, updating, and removing repositories are essential skills for any developer who work with Helm. By following the steps that are outlined in this article, we can confidently manage the Helm repositories which enables us to leverage the power of Helm charts and simplify the deployment of applications in Kubernetes clusters.

Similar Posts