Install chart :

helm install mysite bitnami/drupal

helm repo list
helm search repo brigade
helm search hub wordpress
helm list

Upgrade install :
helm upgrade mysite bitnami/drupal
helm upgrade mysite bitnami/drupal —reuse-values

Show values :
helm show values bitnami/wordpress
helm show values bitnami/wordpress > values.yaml

helm uninstall mysite
helm uninstall —keep-history

helm install mysite bitnami/drupal —values values.yaml —set drupalEmail=foo@example.com —dry-run
helm template mysite bitnami/drupal —values values.yaml —set drupalEmail=foo@example.com

helm get values wordpress
helm get values wordpress —revision 2
helm get values wordpress —all

helm history wordpress
helm rollback wordpress 2

helm install bitnami/wordpress —generate-name
NAME: wordpress-1597689085

helm install bitnami/wordpress —generate-name —name-template “foo-{{ randAlpha 9 | lower }}“
NAME: foo-yejpiyjmp

helm install drupal bitnami/drupal —namespace mynamespace —create-namespace

helm upgrade —install wordpress bitnami/wordpress
Release “wordpress” does not exist. Installing it now.

helm package anvil

Methods

In addition to the values, information about the release, as first described in Chap‐
ter 2, can be accessed as properties of .Release. This information includes:
.Release.Name
The name of the release.
.Release.Namespace
Contains the namespace the chart is being released to.
.Release.IsInstall
Set to true when the release is a workload being installed.
.Release.IsUpgrade
Set to true when the release is an upgrade or rollback.
.Release.Service
Lists the service performing the release. When Helm installs a chart, this value is
set to “Helm”. Different applications, those that build on Helm, can set this to
their own value.

The information in the Chart.yaml file can also be found on the data object at .Chart.
This information does follow the schema for the Chart.yaml file. This includes:
.Chart.Name
Contains the name of the chart.
.Chart.Version
The version of the chart.
.Chart.AppVersion
The application version, if set.
.Chart.Annotations
Contains a key/value list of annotations

Functions

https://helm.sh/docs/chart_template_guide/function_list/

{{- if or (eq .Values.character “Wile E. Coyote”) .Values.products -}}
…
{{- end }}

{{- if .Values.ingress.enabled -}}
…
{{- else -}}

Ingress not enabled

{{- end }}

{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}

{{ (lookup “apps/v1” “Deployment” “anvil” “runner”).metadata.annotations }}

Variables

{{ var := .Values.character }} {{ var = “Tweety” }}

Loops

An example list in YAML

characters:

  • Sylvester
  • Tweety
  • Road Runner
  • Wile E. Coyote

In this case range iterates over each item in the list and sets the value of . to the value
of each item in the list as Helm iterates over the item

characters:
{{- range .Values.characters }}

  • {{ . | quote }}
    {{- end }}

An example map in YAML

products:
anvil: They ring like a bell
grease: 50% slippery
boomerang: Guaranteed to return

products:
{{- range value := .Values.products }}

  • {{ key }}: {{ value | quote }}
    {{- end }}

Named templates

{{- define “anvil.getImage” -}}
{{- if .Values.image.digest -}}
{{ .Values.image.repository }}@{{ .Values.image.digest }}
{{- else -}}
{{ .Values.image.repository }}:
{{- .Values.image.tag | default .Chart.AppVersion }}
{{- end -}}
{{- end -}}

Utilizing a dry-run isn’t the only way you can get access to this feature. The
helm template command provides a similar experience but without the full debug‐
ging feature set. The template command does turn the template commands into
YAML. At this point it will provide an error if the generated YAML cannot be parsed.
What it won’t do is validate the YAML against the Kubernetes schema. The template
command won’t warn you if apiVersion is turned to foo. This is due to Helm not
communicating with a Kubernetes cluster to get the schema for validation when the
template command is used.