Now that Helm is installed, let's dive into the core functionalities of working with Helm. Whether you're installing a new application, upgrading an existing deployment, or managing multiple releases, Helm makes Kubernetes operations much simpler.
1. Installing a Chart
The primary function of Helm is to install applications using Charts. A Chart is a package of pre-configured Kubernetes resources, and you can install it into your cluster using the helm install
command. Here’s an example of installing Nginx from the Bitnami repository:
helm install my-nginx bitnami/nginx
- my-nginx: This is the name of the release. You can choose any name for your release.
- bitnami/nginx: This specifies the repository and chart you want to install.
After running the command, Helm will deploy Nginx and output details about the resources created in your cluster.
2. Listing Installed Releases
To see which Helm-managed applications (or Releases) are installed in your cluster, use the helm list
command:
helm list
This will display a list of all releases, including their names, statuses, and the Chart version they are using.
3. Viewing a Release
If you want to inspect a specific release for details like the status, associated resources, or last revision, you can use the helm status
command:
helm status my-nginx
This command shows detailed information about the release, including the current state of the application, which can be helpful for debugging.
4. Upgrading a Release
One of the key features of Helm is the ability to upgrade a release with new configurations or Chart versions without redeploying everything from scratch. Let’s say you want to change the service type of Nginx from the default to NodePort
. You can do this by upgrading the release:
helm upgrade my-nginx bitnami/nginx --set service.type=NodePort
In this command:
-
helm upgrade
tells Helm to update an existing release. -
my-nginx
is the release name. -
bitnami/nginx
is the chart you are upgrading. -
--set service.type=NodePort
overrides the default service type.
Helm will make the changes in your cluster without interrupting the application unless necessary.
5. Rolling Back a Release
Sometimes, things don't go as planned after an upgrade. Helm makes it easy to revert back to a previous version with the helm rollback
command:
helm rollback my-nginx 1
The number 1
refers to the revision number you want to roll back to. Helm keeps track of all your releases' revisions, so you can easily roll back to a previous version if something goes wrong.
6. Uninstalling a Release
If you no longer need a particular release, Helm allows you to uninstall it, which will clean up all the associated Kubernetes resources:
helm uninstall my-nginx
This command will delete all Kubernetes resources associated with the my-nginx
release, but the release history is retained by Helm, allowing you to reinstall it later if needed.
These commands form the foundation of working with Helm, helping you install, manage, and update applications in your Kubernetes cluster efficiently. In the next section, we’ll explore how to customize Helm Charts to better fit your specific application needs.
Top comments (0)