This guide highlights key operations and commands available with Helm for managing deployments on Kubernetes efficiently.
With Helm installed, you can easily manage deployments on Kubernetes using the Helm command-line interface (CLI). This guide highlights key operations and commands available with Helm, ensuring you get started quickly and efficiently.When you run the Helm command without parameters, it displays a comprehensive help menu that provides a quick reference for common actions. 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 to view- helm install: upload the chart to Kubernetes- helm list: list releases of chartsUsage: 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 help output serves as a handy reference; for instance, if you’re considering rolling a release back to a previous version, you might initially search for a helm restore command. The help text quickly clarifies that the correct command for this operation is helm rollback.
Helm provides a variety of subcommands to manage tasks, including repository-related functions. To see all commands related to chart repositories—such as adding, listing, or removing repositories—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 more detailed information on a specific operation, such as updating your local cache of chart repository data, you can view its help instructions:
Copy
Ask AI
$ helm repo update --helpUpdate gets the latest information about charts from the respective chart repositories.Information is cached locally and used by commands like 'helm search'.Usage: helm repo update [flags]Aliases: update, up
By frequently updating your local repository information, you ensure that you always have access to the latest charts available.
Helm simplifies the deployment of applications on Kubernetes. As a practical example, let’s deploy a WordPress website using a prepackaged chart from the Bitnami repository. Follow these steps:
Add the Bitnami repository to your Helm configuration.
Deploy the WordPress application using the helm install command.
Here are the commands to execute:
Copy
Ask AI
$ helm repo add bitnami https://charts.bitnami.com/bitnami"bitnami" has been added to your repositories$ 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 streamlined process clearly demonstrates how Helm facilitates application deployments on Kubernetes. Typically, the chart’s README includes additional configuration details, allowing further customization of your deployment.Once the chart is deployed, you can always confirm your active releases by listing them:
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
To completely remove the deployed WordPress website and its associated Kubernetes objects, use the uninstall command:
Managing chart repositories with Helm is intuitive. You can add, list, remove, or update repositories using the helm repo commands. For example, to view your current repositories and update their information, run:
Copy
Ask AI
$ helm repo listNAME URLbitnami https://charts.bitnami.com/bitnami$ 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 process is akin to updating package manager repositories on Linux systems, ensuring that your local cache of available charts is always up-to-date.
Explore our labs to experiment with these Helm CLI operations in your Kubernetes environment. This hands-on experience will help solidify your understanding.
That’s all for now. Happy Helming, and see you in the next article!