Learnitweb

Managing Helm Packages in Kubernetes: Listing and Uninstalling

Introduction

Helm is a powerful tool for managing Kubernetes applications. In addition to installing packages, it is essential to know how to list installed packages and uninstall them when necessary. In this tutorial, we will cover how to use Helm to list all installed packages and how to uninstall a package from a Kubernetes cluster.

Listing Installed Helm Packages

To view all Helm packages installed in your Kubernetes cluster, use the following command:

helm list

This command provides details about each installation, including:

  • Name: The installation name (e.g., mydb).
  • Namespace: By default, Helm queries the default namespace.
  • Revision: Indicates the version number of the installation. If the package has not been upgraded, this value will be 1.
  • Last Updated: The date and time of the last modification.
  • Status: Displays the current state of the package (e.g., deployed).
  • Chart: The name and version of the Helm chart used (e.g., mysql-1.6.7).
  • App Version: The actual application version (e.g., MySQL 8.0).

Listing Packages in a Specific Namespace

By default, helm list retrieves information from the default namespace. To list Helm releases in a specific namespace, use the -n or --namespace flag:

helm list -n team-two

or

helm list --namespace team-two

This command will display only the installations within the team-two namespace.

Uninstalling a Helm Package

To remove a Helm installation from your Kubernetes cluster, use the helm uninstall command followed by the installation name:

helm uninstall mydb

By default, this command removes the package from the default namespace. To confirm the uninstallation, you can check running pods:

kubectl get pods

If the installation was removed successfully, its associated pods will no longer be listed.

Uninstalling a Package from a Specific Namespace

If the package was installed in a different namespace, specify the namespace using -n or --namespace:

helm uninstall mydb -n team-two

or

helm uninstall mydb --namespace team-two

This will remove the installation from the team-two namespace.

Summary

  • Use helm list to view installed packages.
  • Use helm list -n <namespace> to list installations within a specific namespace.
  • Use helm uninstall <package-name> to remove an installation from the default namespace.
  • Use helm uninstall <package-name> -n <namespace> to remove an installation from a specific namespace.

By following these steps, you can effectively manage Helm deployments and keep your Kubernetes cluster organized.