How is versioning implemented in Helm?
sobes.tech AI
Answer from AI
Versioning in Helm is carried out on two levels:
-
Chart Version: Defines the version of the entire Helm Chart. It changes when any modifications are made to templates, default values, or Chart metadata. It is specified in the
Chart.yamlfile. -
App Version: Defines the version of the actual application delivered by this Chart. It is specified in the
Chart.yamlfile and is purely informational for the end user of the Chart. It does not affect Helm's operation.
Chart.yaml file:
# Metadata file for the Chart
apiVersion: v2 # Helm API version
name: my-app # Name of the Chart
description: My application # Description of the Chart
version: 1.2.3 # Chart version. It is recommended to follow SemVer.
appVersion: "2.5.0" # Application version. String.
Release lifecycle and versioning:
Every time you install or upgrade a Helm Chart, Helm creates a new release. Each release has a unique revision number. This number increases with each helm install, helm upgrade, or helm rollback operation for the same release name.
Examples of working with releases:
# Installing a Chart (creating a release, revision 1)
helm install my-release ./my-chart
# Upgrading a Chart (creating a new release version, revision 2)
helm upgrade my-release ./my-chart
# Rolling back to a previous release version (creating a new release version, revision 3)
helm rollback my-release 2
# Viewing release history
helm history my-release
Using versions during install and upgrade:
When installing or upgrading a Chart from a repository, you can specify a specific version using the --version flag:
# Installing a specific Chart version
helm install my-release my-repo/my-chart --version 1.2.3
# Upgrading to a specific Chart version
helm upgrade my-release my-repo/my-chart --version 1.3.0
Thus, Helm versioning covers both the package (Chart) itself with its contents and the deployment history of that package (releases).