This guide covers the basics of using Helm, the Kubernetes package manager, and its command-line interface for deploying applications.
In this guide, you will explore the fundamentals of Helm—the Kubernetes package manager—and learn how to use its command-line interface (CLI) for various tasks. Every operation demonstrated here is executed through the Helm CLI.
Running the helm command without arguments, or with the --help flag, displays useful information about available commands and their usage. For example:
Copy
Ask AI
$ helm --helpThe Kubernetes package managerCommon actions for Helm:- helm search: search for charts- helm pull: download a chart to your local directory for inspection- helm install: deploy a chart onto Kubernetes- helm list: list chart releasesUsage: helm [command]Available Commands: completion generate autocompletion scripts for the specified shell create create a new chart with the given name dependency manage a chart's dependencies env helm client environment information get download extended information of a named release help Help about any command history fetch release history
This output serves as a quick reference for determining the proper command for a specific task. For example, if you’re trying to recover from a failed upgrade, this help message reminds you that the correct command is helm rollback rather than a non-existent helm restore.
Helm offers detailed assistance for managing chart repositories through subcommands. To view all available commands for repository management, execute:
Copy
Ask AI
$ helm repo --helpThis command consists of multiple subcommands to interact with chart repositories.It can be used to add, remove, list, and index chart repositories.Usage: helm repo [command]Available Commands: add add a chart repository index generate an index file given a directory containing packaged charts list list chart repositories remove remove one or more chart repositories update update information of available charts locally from chart repositories
For example, if you want to update your local chart cache, you can review the detailed help for that subcommand:
Copy
Ask AI
$ helm repo update --helpUpdate gets the latest information about charts from the respective chart repositories.Information is cached locally, where it is used by commands like 'helm search'.Usage: helm repo update [flags]Aliases: update, up
Helm significantly simplifies the deployment of applications in Kubernetes. In this section, you will deploy a WordPress website using a prepackaged Helm chart available on online repositories like Artifact Hub. Look for official or verified publisher badges to identify high-quality charts.
Begin by adding the Bitnami chart repository to your local Helm configuration
Begin by adding the Bitnami chart repository to your local Helm configuration.
Copy
Ask AI
$ helm repo add bitnami https://charts.bitnami.com/bitnami"bitnami" has been added to your repositories
With the repository added, deploy the WordPress chart to your Kubernetes cluster
With the repository added, deploy the WordPress chart to your Kubernetes cluster.
Copy
Ask AI
$ helm install my-release bitnami/wordpressNAME: my-releaseLAST DEPLOYED: Wed Nov 10 18:03:50 2021NAMESPACE: defaultSTATUS: deployedREVISION: 1TEST SUITE: NoneNOTES:CHART NAME: wordpressCHART VERSION: 12.1.27APP VERSION: 5.8.1** Please be patient while the chart is being deployed **Your WordPress site can be accessed through the following DNS name from within your cluster:my-release-wordpress.default.svc.cluster.local (port 80)
This output confirms that your WordPress application has been successfully deployed as a release named my-release.
To view all installed releases, use the helm list command
To view all installed releases, use the helm list command.
Copy
Ask AI
$ helm listNAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSIONmy-release default 1 2021-11-10 18:03:50.414174217 +0000 UTC deployed wordpress-12.1.27 5.8.1
When you need to remove the WordPress deployment, Helm allows you to easily c…
When you need to remove the WordPress deployment, Helm allows you to easily clean up all associated Kubernetes objects.
Helm repositories store charts and their associated metadata. In addition to adding repositories with helm repo add, you can list and update your chart repositories as needed.
Update Repositories:
Similar to a system package manager, refresh the local cache of repository information with:
Copy
Ask AI
$ helm repo updateHang tight while we grab the latest from your chart repositories......Successfully got an update from the "bitnami" chart repositoryUpdate Complete. Happy Helming!
This ensures you have the most up-to-date chart information from each repository.
Helm supports powerful search capabilities to help you find the right chart. You can search for charts hosted on the Artifact Hub or within your local repositories.
$ helm search wordpressSearch enables you to look for Helm charts in multiple locations, including the Artifact Hub and locally added repositories.Usage: helm search [command]Available Commands: hub search for charts in the Artifact Hub or your own hub instance repo search repositories for a keyword in charts
Using these search options, you can review important chart details such as version numbers and descriptions before installation.
Helm streamlines the deployment and management of applications on Kubernetes. Whether you’re deploying a WordPress website or another application, the Helm CLI offers a powerful and user-friendly set of commands to add repositories, install charts, monitor releases, and remove deployments—all from the command line.Now that you understand these fundamental operations, try them out in your own environment. Happy Helming!