# add helm repo if needs helm repo add <repo name> <repo URL> \ --username xx \ --password xx
# sync helm repo # you need to run this if any chart version updated helm repo update
# list helm repos helm repo list
# search # -l: lish all verions # --version: regexp to filter version helm search repo <chart name> [-l] [--version ^1.0.0] # CHART VERSION is for chart upgrade or install # show latest VERSION here NAME CHART VERSION APP VERSION DESCRIPTION xxx 2.1.0 3.3.2 xxxxxx
View helm installed chart:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# list installed charts helm list [-n <namespace>]
# check chart history # xxx-1.0.1: xxx is chart name, 1.0.1 is chart version helm history <release name> [-n <namespace>] REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION 1 Mon Oct 11 19:41:41 2021 superseded xxx-1.0.1 1.8.3 Install complete 2 Mon Oct 18 17:39:37 2021 superseded xxx-1.0.2 1.8.3 Upgrade complete 3 Mon Oct 18 17:41:29 2021 superseded xxx-1.0.1 1.8.3 Rollback to 1 4 Mon Oct 18 17:44:21 2021 superseded xxx-1.0.1 1.8.3 Upgrade complete 5 Mon Oct 18 17:55:28 2021 deployed xxx-1.0.2-66 1.8.3 Upgrade complete
# get current chart values # edit if necessary helm get values <release name> [-n <namespace>] > values.yaml
# upgrade with specified version and values.yaml # -f: specify vaules if necessary, if not, will reuse the existing as helm get values output # where to get version: helm search helm install/upgrade <release name> [repo/chart] [-n <namespace>] --version <version> [-f values.yaml] # helm upgrade example gcloud-helm/example --version 1.0.1 -f values.yaml # if run helm history, will displayed as xxx-1.0.3 in CHART column # 1.0.3 is the --version value # note that if the version format is 1.0.3.19, have to convert to 1.0.3-19 in command
# see upgrade result helm history <release name> [-n <namespace>]
Rollback chart:
1 2 3 4 5 6 7
# REVISION is from helm history, see above # if REVISION is ignored, rollback to previous release helm rollback <release name> [-n <namespace>] [REVISION] # note that rollback will also rollback the values
# see rollback result helm history <release name> [-n <namespace>]
Uninstall and install chart:
1 2 3
# --keep-history if necessary # in case need to rollback helm uninstall <release name> [--keep-history] [-n <namespace>]
Download chart package to local:
1 2 3 4
# helm-repo is repo name from "helm repo list" # example is chart name from that repo # --version specify version of the chart helm pull helm-repo/example --version 1.0.1
Local Chart
For developing purpose, we can install directly from local chart folder.
You need to create Chart.yaml which contains chart version, appVersion, etc.
# without k8s cluster # rendering template and check # --debug: verbose output helm template [--values <path to yaml file>] \ [--debug] \ <path to chart folder> \ | less
# in k8s cluster # real helm install but without commit # can generate a release name as [release] helm install [release name] <path to chart folder> \ [-n <namespace>] \ --dry-run \ --debug 2>&1 \ | less
# real install helm install [release name] <path to chart folder>