Skip to content

9.1. Helm Charts

When to Use It

  • When installing an application made of several resources in one go
  • When deploying the same application per environment with only the values changed
  • When a setting change causes a problem and you have to return to the previous state

The Problem of Deploying Several Resources Together

Deploying one application requires several resources.

ResourceWhat it does
DeploymentRuns the application
ServiceGives it a fixed name
IngressConnects external access
ConfigMapHolds settings
SecretHolds passwords
PVCRequests storage

Creating these separately causes problems.

  • The order has to be kept (a PVC must exist before the Deployment starts)
  • Missing even one means it does not work
  • Deleting means finding and removing them one by one
  • Values differing per environment have to be edited in each place

What Helm Is

It is the tool for bundling several resources to install, change, and delete them together. It corresponds to a package manager for Kubernetes.

Here is what Helm solves.

ProblemHow Helm solves it
Several resourcesInstalled and deleted together with one command
Values differ per environmentReuse the same chart with only the values changed
Rolling back is hardKeeps a revision history to revert to
You do not know what is installedManaged by release

Chart · Release · Revision

Three words have to be distinguished.

WordMeaningAnalogy
ChartThe bundle of deployment definitions. It holds resource templates and defaultsAn installer file
ReleaseOne result of installing a chartAn installed program
RevisionThe number that increases each time a release is changedThe change history

The same chart can be installed several times with different names. For example, one database chart can produce two releases, db-dev and db-prod.

A chart holds templates and defaults. Passing values at install time fills them into the templates, producing the actual resource definitions.

How resources are produced from a chart

The Release List

Go to Helm Charts > Releases.

Helm release list
ColumnDescription
NameThe release name
NamespaceThe namespace it is installed in
ChartThe chart name and version
App versionThe application version
StatusThe installation result
RevisionWhich change number it is

The chart version and the app version are different.

VersionThe version of what
Chart versionThe version of the deployment definitions. It rises even if only the templates change
App versionThe version of the application inside it

A chart version increasing does not mean the application is a new version.

Release Statuses

StatusMeaningWhat to do next
deployedInstalled normallyNothing
failedInstallation or change failedCheck the manifest and resource statuses on the detail
pending-installInstallation in progressIf it lingers, check resource statuses
pending-upgradeChange in progressThe same as above
supersededReplaced by a newer revisionThis is normal. It is a value left in the history

Lingering in pending-* usually means pods cannot start. Find the pods the release created and check their events (see 3.1).

Release Detail

Selecting the name opens the detail screen.

TabContentWhen you look at it
ValuesThe setting values specified at install timeWhen checking which values it was installed with
ManifestThe resource definitions actually createdWhen checking how the values were applied
ResourcesThe list of resources this release createdWhen checking the scope of impact
NotesThe guidance the chart providesAccess instructions after installation, and so on
HistoryThe change record per revisionWhen choosing a revision to revert to

The Difference Between Values and Manifest

Distinguishing these two finds problems faster.

TabWhat it shows
ValuesOnly the values you supplied
ManifestThe final result with the chart defaults merged in

When "I supplied a value but it was not applied", look at the manifest. It is one of three things.

CauseHow to confirm
The value name is wrongIt is not reflected in the manifest
The chart does not use that valueIt is on the Values tab but not in the manifest
Another value overrode itA different value appears in the manifest

Managing Repositories

Manage where charts come from under Helm Charts > Repositories.

Helm repository list
ItemDescription
NameThe repository alias
URLThe repository URL

In an air-gapped environment, only the internal repository (ChartMuseum) is registered. External repositories cannot be reached. If a new chart is needed, operations staff have to upload it to the internal repository.

Installing and Upgrading

  1. Choose a chart from a repository.
  2. Decide the release name and the namespace to install into.
  3. Review the setting values and edit what you need.
  4. Run the installation.

To change the settings of an already installed release, run an upgrade from the detail screen. The revision number increases by one and the previous revision becomes superseded.

Release names must be unique within a namespace. To install again with the same name, delete it first.

Rolling Back

Choose a revision on the History tab and revert.

Revision numbers move forward even on a rollback. Reverting from revision 3 to revision 2 creates revision 4 with the same content as revision 2. This is the same as a Deployment rollback (see 3.2).

A rollback reverts the chart and the values.

What revertsWhat does not
Resource definitions (Deployment, Service, and so on)Data inside a database
Setting valuesFiles inside a PVC
Container image tagsThe state of external systems

An upgrade that changed the database schema can leave problems even after a rollback, because the older version cannot read data in the new format. Before upgrading, check whether the chart's notes mention rollback limitations.

Cautions When Deleting

Deleting a release deletes the resources it created. The following are exceptions, however.

ResourceDoes it remain
PVCSometimes, depending on the chart settings
Resources created manuallyYes
CRDsMostly yes (see 8.2)

Delete only when you are certain the data is no longer needed. Before deleting, check on the Resources tab what will disappear with it, and clean up PVCs separately on the storage screen (see 6.1).

The Difference Between Helm and Console Deployment

There are several ways to deploy the same application.

MethodWhen it fits
Creating resources directly in the ConsoleWhen there are only one or two resources and it is simple
The deploy button on the build screenWhen deploying what you just built from source (see 4.2)
HelmWhen there are several resources and you need rollbacks and per-environment value management
A Jenkins pipelineWhen you need an approval process and history (see 4.4)

Do not edit the resources of a Helm-installed release directly in the Console. Helm remembers the state it created, so that change disappears at the next upgrade. Change it only by editing the values and upgrading.