Common operations

Add Helm Repository

helm repo add NAME URL

e.g. for the Bitnami repository:

helm repo add bitnami https://charts.bitnami.com/bitnami                                                                                                                                                         1 ↵
"bitnami" has been added to your repositories

List Repositories

helm repo list                                                                                                                                                                                                 130 ↵
NAME    URL
bitnami https://charts.bitnami.com/bitnami

Searching in a Helm Repository

helm search repo wordpress
NAME                    CHART VERSION   APP VERSION     DESCRIPTION
bitnami/wordpress       15.2.30         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress-intel 2.1.31          6.1.1           DEPRECATED WordPress for Intel is the most popu...

Search Repository and display existing versions

helm search repo wordpress --versions
NAME                    CHART VERSION   APP VERSION     DESCRIPTION
bitnami/wordpress       15.2.30         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.29         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.28         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.27         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.26         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.25         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.24         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.23         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.22         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.21         6.1.1           WordPress is the world's most popular blogging ...
bitnami/wordpress       15.2.20         6.1.1           WordPress is the world's most popular blogging ...
[..]

Install a Package

helm install INSTANCENAME PACKAGE

e.g. installing Wordpress from the Bitnami repository..

helm install myblog bitnami/wordpress
NAME: myblog
LAST DEPLOYED: Wed Jan 18 15:15:45 2023
NAMESPACE: helmtry
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: wordpress
CHART VERSION: 15.2.30
APP VERSION: 6.1.1

** Please be patient while the chart is being deployed **

Your WordPress site can be accessed through the following DNS name from within your cluster:

    myblog-wordpress.helmtry.svc.cluster.local (port 80)

To access your WordPress site from outside the cluster follow the steps below:

1. Get the WordPress URL by running these commands:

  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: 'kubectl get svc --namespace helmtry -w myblog-wordpress'

   export SERVICE_IP=$(kubectl get svc --namespace helmtry myblog-wordpress --include "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
   echo "WordPress URL: http://$SERVICE_IP/"
   echo "WordPress Admin URL: http://$SERVICE_IP/admin"

2. Open a browser and access WordPress using the obtained URL.

3. Login with the following credentials below to see your blog:

  echo Username: user
  echo Password: $(kubectl get secret --namespace helmtry myblog-wordpress -o jsonpath="{.data.wordpress-password}" | base64 -d)

Show configurable values for a Chart

e.g. for Bitnamis Wordpress Chart

helm show values bitnami/wordpress|head -20
## @section Global parameters
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass
##

## @param global.imageRegistry Global Docker image registry
## @param global.imagePullSecrets Global Docker registry secret names as an array
## @param global.storageClass Global StorageClass for Persistent Volume(s)
##
global:
  imageRegistry: ""
  ## E.g.
  ## imagePullSecrets:
  ##   - myRegistryKeySecretName
  ##
  imagePullSecrets: []
  storageClass: ""

## @section Common parameters
[..]

Show configured values for an installed release

helm get values RELEASENAME

e.g. getting all values for a wordpress release

helm get values myblog --all

COMPUTED VALUES:
affinity: {}
allowEmptyPassword: true
allowOverrideNone: false
apacheConfiguration: ""
args: []
autoscaling:
  enabled: false
  maxReplicas: 11
  minReplicas: 1
  targetCPU: 50
  targetMemory: 50
clusterDomain: cluster.local
command: []
common:
  exampleValue: common-chart
  global:
    imagePullSecrets: []
    imageRegistry: ""
    storageClass: ""
[..]

Install Chart and override Configuration

e.g. we want to override the Wordpress user name .. creating a YAML file like this using the correct key from the inspection above …​

values.yaml
wordpressUsername: "iareroot"

then we run the installation like this:

helm install myblog bitnami/wordpress --values values.yaml

In the excerpt from the Notes we can see, that this values has been applied successfully…​

Notes output
3. Login with the following credentials below to see your blog:

  echo Username: iareroot
  echo Password: $(kubectl get secret --namespace somens myblog-wordpress -o jsonpath="{.data.wordpress-password}" | base64 -d)

another way is to set the variable in the command line like this:

helm install myblog bitnami/wordpress --set wordpressUsername="xoxo"

Dry run install/upgrade

helm install NAME CHART --dry-run

Check Templates with Dependencies (Dry run)

helm template ./charts/mychart --dry-run --debug --dependency-update