| sidebar_position | 1 | |||
|---|---|---|---|---|
| title | Helm Introduction | |||
| description | Learn about Helm and its benefits. | |||
| tags |
|
|||
| keywords |
|
|||
| slug | /helm |
Helm is a package manager and templating tool for Kubernetes. It helps you define, install, upgrade, and manage Kubernetes applications using reusable charts. A common comparison is that Helm is like apt, yum, or brew, but for Kubernetes applications.
Its main use case is application deployment and environment-specific configuration management.
Helm 3 has a simpler architecture than Helm 2. The server-side component called Tiller was removed, so Helm now works as a client-side application that talks directly to the Kubernetes API server.
To deploy an application using Helm, you need to create a Helm chart. A Helm chart is a collection of files that describe a related set of Kubernetes resources. A single chart might be used to deploy something simple, like a memcached pod, or something complex, like a full web app stack with HTTP servers, databases, caches, and so on.
First, add the chart repository:
helm repo add bitnami https://charts.bitnami.com/bitnami- Update the local repository index:
helm repo update- Install the chart:
helm install postgres bitnami/postgresqlSearch for available charts:
helm search repo bitnamiSearch for the available versions of a chart:
helm search repo bitnami/postgresql --versionsYou can also pull the chart locally to inspect its files. The --version flag refers to the chart version, not the application version.
helm pull bitnami/postgresql --version 16.3.0You can pass custom values to the chart with a values file:
helm install postgresql bitnami/postgresql --values values.yamlFor example, the values.yaml file can look like this:
commonAnnotations:
foo: barWe can upgrade the chart using the following command
helm upgrade --install postgresql bitnami/postgresql --values values.yaml --version=16.4.0 --namespace=my-namespaceYou can roll back the chart using the following command. Here postgresql is the release name, which you can get from helm list.
helm rollback postgresqlTo check Helm releases:
helm listTo check the values provided by the user. Again, postgresql is the release name:
helm get values postgresqlYou can also inspect the rendered Kubernetes manifests generated by the chart. Again, postgresql is the release name:
helm get manifest postgresqlYou can uninstall the chart using the following command. Again, postgresql is the release name:
helm uninstall postgresql- You can create your own Helm chart using the following command. It generates a directory with the boilerplate files.
helm create mychart- You can install the chart using the following command.
mychartis the release name and./mychartis the chart path.
helm install mychart ./mychartWe can also apply with a values file
helm install mychart ./mychart --values values.yamlHelm hooks are a way to interact with the lifecycle of a release. They allow you to intervene at certain points in a release's life cycle. Helm supports the following hooks:
pre-install- Runs before any templates are rendered.post-install- Runs after all templates have been rendered and resources have been created.
- Learning Resources - Learn more about Helm with these resources.