Helm packages are named helm charts.
A chart contains:
- a "Chart.yaml" file.
- a "templates" directory (contains Kubernetes' manifests).
- an optional default configuration file "values.yaml".
Installing a chart involves the following steps:
- Helm reads the chart.
- Helm replaces the custom values in their corresponding place holders in the chart templates.
- Helm sends the updated templates (manifests) to Kubernetes (which creates the requested resources).
When you run the "
helm install" command on a chart, you start a new installation of that chart (a first release is created).
When you run the "
helm uprade" command on a chart, you start an upgrade of an existing installation of that chart (a new release is created).
A new release is also created when you rollback an installation.
A helm chart has two versions:
- the chart version: the version of the chart.
- the app version: the version of the application packaged in the chart.
The chart version and the app version are defined in the file "
Chart.yaml":
apiVersion: v2
name: test
description: test chart
version: 1.0.0
appVersion: 1.0.0
Helm uses the chart version to make versioning decisions.
Multiple charts with different versions may have the same app version.
To install a chart you need to specify its path and a name of the installation.
The name of the installation identifies a specific instance of the chart and hence it must be unique within a Kubernetes' namespace.
Installing a chart using an existing installation's name, within the same namespace, will result with an error.
To install a chart, use this command:
$ helm install my-chart-install-name my-chart-package-location
You can spefify a Kubernetes' namespace where the chart will be installed:
$ helm install --namespace my-namespace my-chart-install-name my-chart-package-location
The output of running the helm install/upgrade commands is printed in the screen:
NAME:
LAST DEPLOYED:
NAMESPACE:
STATUS:
REVISION:
TEST SUITE:
You can provide more information about the installation by adding a file with the name "
NOTES.txt" under the "
templates" folder of the helm chart:
https://helm.sh/docs/chart_template_guide/notes_files/
You can also use the
helm get notes my-chart-install-name command to print the output of the execution of these commands.
You can list your charts installations using the "
helm list" command:
$ helm list
This will list the installations in the current namespace along with some information for each installation
(name, namespace, revision number, last update date, status, version of the chart, version of the app).
To use another namespace, use the "
--namespace" flag (or "
-n"):
$ helm list --namespace my-namespace
To list all installations in all namespaces to which you have access, you can use the "
--all-namespaces" flag:
$ helm list --all-namespaces
To uninstall a chart installation, you can use the "
helm uninstall" command:
$ helm uninstall my-chart-install-name
You can use the "
--namespace" flag to uninstall a chart in a specific namespace:
$ helm uninstall my-chart-install-name --namespace my-namespace