In this tutorial, we aim to understand how to manage Helm releases and perform rollbacks. Helm is a package manager for Kubernetes that allows developers and operators to more easily package, configure, and deploy applications and services onto Kubernetes clusters.
By the end of this tutorial, you will be able to:
Before you start with this tutorial, you should have the following:
To manage Helm releases, we use the helm upgrade and helm delete commands.
To update a release, we use the helm upgrade command followed by the release name and the chart name.
helm upgrade [RELEASE] [CHART]
To delete a release, we use the helm delete command followed by the release name.
helm delete [RELEASE]
Let's say you have a release named myapp of the chart mychart. To upgrade this release, you would use the following command:
helm upgrade myapp mychart
This command upgrades the myapp release to the latest version of the mychart chart.
If you want to delete the myapp release, you would use the following command:
helm delete myapp
This command removes the myapp release from your Kubernetes cluster.
To rollback a release, we use the helm rollback command followed by the release name and the revision number.
helm rollback [RELEASE] [REVISION]
For example, to rollback the myapp release to its first revision, you would use the following command:
helm rollback myapp 1
This command rolls back the myapp release to its first revision.
In this tutorial, we have covered how to manage Helm releases and perform rollbacks. Specifically, we've learned how to update, delete, and rollback releases using Helm.
For further learning, you might want to look into how to create your own Helm charts and how to use Helm in combination with continuous integration/continuous delivery (CI/CD) systems.
You have a release named myapp2 of the chart mychart2. Update this release using the appropriate Helm command.
To update the myapp2 release, we use the helm upgrade command as follows:
helm upgrade myapp2 mychart2
This command updates the myapp2 release to the latest version of the mychart2 chart.
You have a release named myapp2 that you want to delete. Delete this release using the appropriate Helm command.
To delete the myapp2 release, we use the helm delete command as follows:
helm delete myapp2
This command deletes the myapp2 release from your Kubernetes cluster.
You have a release named myapp3 that you want to rollback to its second revision. Rollback this release using the appropriate Helm command.
To rollback the myapp3 release to its second revision, we use the helm rollback command as follows:
helm rollback myapp3 2
This command rolls back the myapp3 release to its second revision.