Helm is a package manager for Kubernetes, and a Helm Chart is a manifest that represents the desired state of application resources deployed to a Kubernetes cluster. See the Helm website for the latest version and commands.
Helm Commands (v3.10)
CHART='path_to_chart'
DIRECTORY='directory_name'
NAME='app_name'
NAMESPACE='kubernetes_namespace'
REGISTRY_NAME='helm_registry_name' (e.g. rancher-latest, acrteam.azurecr.io)
REGISTRY_URL='path_to_registry' (e.g. https://releases.rancher.com/server-charts/latest, https://acrteam.azurecr.io/helm/v1/repo)
RELEASE='release_number'
VALUES='path_to_values_yaml_file'
Often used flags
--debug
--> show output on screen
--dry-run
--> test, but don't run
--namespace
--> $NAMESPACE
--output
-o
--> output to json, yaml (defaults to table)
--values
-f
--> a YAML file with value variables
Create a chart
helm create $NAME
Install, upgrade or remove a chart
helm install --values $VALUES $NAME $CHART
helm install --values $VALUES $NAME $CHART --dry-run --debug
helm install --values $VALUES $NAME-$RELEASE $CHART
helm install --values $VALUES $NAME $REGISTRY_NAME/$CHART
An upgrade requires knowing the installed $NAME-$RELEASE>
, and can run an install if the named release does not already exist
helm upgrade --values $VALUES $NAME-$RELEASE $CHART
helm upgrade --values $VALUES $NAME-$RELEASE $CHART --dry-run --debug
helm upgrade --values $VALUES $NAME-$RELEASE $CHART --install
helm delete $NAME $CHART <flags>
helm remove $NAME $CHART <flags>
List running Helm charts
helm list
helm list | grep $NAME
helm list --all-namespaces
Download a chart
helm pull $CHART
helm pull $REGISTRY/$CHART
Download a chart and extract the archive’s contents into a directory
helm pull $CHART --untar --untardir $DIRECTORY
Inspect a chart and list its contents
helm show all $CHART
Display the chart’s definition
helm show chart $CHART
Display the chart’s values
helm show values $CHART
helm get values $NAME
Package a chart into a chart archive
helm package $CHART
helm package $CHART | awk -F'[:]' '{gsub(/ /, "", $2); print $2}'
Display or update a chart’s dependencies
helm dependency list $CHART
helm dependency update
Initialize a Helm Chart repository
helm repo add $REGISTRY_NAME $REGISTRY_URL
helm repo add $REGISTRY_NAME $REGISTRY_URL --username username --password password
helm repo list
helm repo update
Run tests to examine a chart and identify possible issues
helm lint $PATH
Conventions
- Indentation -> follow the indentation style displayed in Helm debug and ArgoCD outputs.
- Annotation order -> order annotations alphabetically like they are displayed in Helm debug and ArgoCD outputs.
- YAML file names -> follow kubectl commands like 'ing', 'deployment'
- Limit .helmignore to single file in the root directory.
- Templatize identical YAML files
Helm References
Helm commands cheat sheet
Chart template guide
Azure Helm
ArgoCD References
Argo automatically fetches desired state from a Helm repo
ArgoCD - user guide
ArgoCD - private repos
ArgoCD - health checks