Helm Integration

Kubernetes Cluster: Helm Integration

Helm is a Kubernetes package manager that simplifies application deployment and lifecycle management. It can install ready-made applications from remote repositories, manage reusable configuration through charts, and maintain application releases with upgrade, rollback, and uninstall operations.
ChartA Helm package containing the Kubernetes resource definitions required to run an application, service, or tool.
RepositoryA location where Helm charts are stored and shared.
ReleaseA specific installed instance of a Helm chart inside a Kubernetes cluster.
Helm is available by default on all Kubernetes control-plane nodes and requires no separate installation. Its version is updated automatically as part of Kubernetes Cluster upgrades.

Find Helm Charts

Helm can search both the public Artifact Hub and repositories configured locally on the Helm client.

1Search Artifact Hub

Use helm search hub to find publicly available charts across community repositories.

helm search hub wordpress
Helm search hub WordPress command
Search Artifact Hub for available WordPress Helm charts.

Use helm search repo to search only repositories already added to the local Helm client.

Manage Helm Repositories

Helm 3, which the source notes is used starting with Kubernetes 1.18.10, does not include a default chart repository. Add the repositories you need manually.

helm repo add bitnami https://charts.bitnami.com/bitnami
Add Bitnami Helm repository
Add the Bitnami chart repository to the Helm client.

List the configured repositories:

helm repo list
Helm repository list
Review the repositories configured for the local Helm client.

Refresh local repository metadata before searching or installing charts:

helm repo update
Update Helm repositories
Update local chart metadata from the configured repositories.

Install a Helm Package

The basic helm install command requires a release name and the chart to install. Chart values can be customized during the installation.

helm install --set wordpressBlogName='My Blog!' mywordpress bitnami/wordpress
Install WordPress Helm chart
Install the Bitnami WordPress chart with a custom blog name.
  • Release name — in this example, mywordpress.
  • Chart — in this example, bitnami/wordpress.
  • Custom value--set wordpressBlogName='My Blog!'.
If you do not want to choose the release name manually, Helm can generate one with the --generate-name option.

Verify the WordPress Example

Public IP consideration: The WordPress chart creates a LoadBalancer service. If the development cluster has only one public IP and access through the shared load balancer is disabled, the WordPress service can consume that IP and make pre-installed ingress-based applications unavailable. Add another public IP to the worker or add another worker node with a public IP when required.
Attach public IP to Kubernetes worker
Attach an additional public IP when the Helm application requires dedicated external access.

The WordPress chart also requires persistent storage. If storage was not enabled during cluster installation, it can be added through the Kubernetes Cluster Configuration add-on.

Add Kubernetes storage
Add Kubernetes storage from the Cluster Configuration add-on when required.

Retrieve the WordPress service URL and administrator password from Kubernetes:

export SERVICE_IP=$(kubectl get svc --namespace default mywordpress --template "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
printf "WordPress URL: http://$SERVICE_IP/\nWordPress Admin URL: http://$SERVICE_IP/admin\nUsername: user\nPassword: $(kubectl get secret --namespace default mywordpress -o jsonpath="{.data.wordpress-password}" | base64 --decode)\n"
Get WordPress Helm chart credentials
Retrieve the service URL and WordPress administrator credentials.
WordPress site installed through Helm
The WordPress site deployed through Helm.
WordPress admin panel
WordPress administration after Helm deployment.

Manage Helm Applications

Helm provides commands for checking release status and configuration, changing values, upgrading releases, restoring previous revisions, and removing applications.

View general Helm help or help for a specific command:

helm help
helm {command} --help
Helm help command
Use Helm’s built-in help to review available commands and options.

Check the current state and deployment information for a release:

helm status mywordpress
Helm release status
Review release status and deployment instructions.

Configuration can be supplied with --set or in a YAML file with --values / -f. When several overrides conflict, later values take priority, and --set has higher precedence.

Review a chart’s default values:

helm show values bitnami/wordpress | less
Helm chart default values
Inspect the available values before installing or upgrading the chart.

Upgrade a Release

Use helm upgrade to move a release to a newer chart version or modify its configuration. Helm attempts to change only the resources affected by the new configuration.

The --reset-values flag can reset custom values and return to the values built into the chart.

For the WordPress chart used in the source example, the existing WordPress and MariaDB passwords must be supplied during upgrade. First retrieve them from Kubernetes secrets:

export WORDPRESS_PASSWORD=$(kubectl get secret --namespace "default" mywordpress -o jsonpath="{.data.wordpress-password}" | base64 --decode)
export MARIADB_ROOT_PASSWORD=$(kubectl get secret --namespace "default" mywordpress-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 --decode)
export MARIADB_PASSWORD=$(kubectl get secret --namespace "default" mywordpress-mariadb -o jsonpath="{.data.mariadb-password}" | base64 --decode)

Then upgrade the release while preserving the current passwords:

helm upgrade --set wordpressPassword=$WORDPRESS_PASSWORD,mariadb.auth.rootPassword=$MARIADB_ROOT_PASSWORD,mariadb.auth.password=$MARIADB_PASSWORD mywordpress bitnami/wordpress
Upgrade WordPress Helm release
Upgrade the WordPress Helm release while keeping its existing credentials.

For many custom parameters, a values file is easier to maintain:

wordpressPassword: %WP_PASS%
mariadb:
  auth:
    rootPassword: %DB_ROOT_PWD%
    password: %DB_PWD%
cat values-template.yaml | sed "s/%WP_PASS%/$WORDPRESS_PASSWORD/g" | sed "s/%DB_ROOT_PWD%/$MARIADB_ROOT_PASSWORD/g" | sed "s/%DB_PWD%/$MARIADB_PASSWORD/g" > values.yaml
helm upgrade -f values.yaml mywordpress bitnami/wordpress

Check the custom values currently stored with a release:

helm get values mywordpress
Get Helm release values
Review the custom values associated with the installed release.

History and Rollback

Each installation, upgrade, or rollback creates a revision. Use Helm history to identify revision numbers:

helm history mywordpress
Helm release history
View the revision history of a Helm release.

Rollback to a selected revision when an upgrade or configuration change does not work as expected:

helm rollback mywordpress 1
Helm rollback command
Restore the release to a previous revision.

Uninstall a Release

Remove a release from the Kubernetes cluster with:

helm uninstall mywordpress

Use --keep-history if the deletion record should remain in Helm history. List currently deployed releases with helm list.

Helm list and uninstall commands
List installed releases and remove an application from the cluster.
Helm workflow summary: Find a chart, add and update the required repository, install a named release, manage configuration with values, upgrade carefully, use release history for rollback, and uninstall the release when it is no longer needed.

What’s next?