April 2018
Intermediate to advanced
468 pages
14h 34m
English
Helm allows rich and sophisticated syntax in the template files through the built-in Go template functions, sprig functions, and pipelines. Here is an example template that takes advantage of these capabilities. It uses the repeat, quote, and upper functions for the food and drink keys, and it uses pipelines to chain multiple functions together:
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap
data:
greeting: "Hello World"
drink: {{ .Values.favorite.drink | repeat 3 | quote }}
food: {{ .Values.favorite.food | upper | quote }}
See if the values file has the following section:
favorite: drink: coffee food: pizza
If it does, then the resulting chart would be as follows:
apiVersion: ...
Read now
Unlock full access