Template values
In previous chapters, we described values as parameters that are used to configure a Helm chart. Now, we will gain an understanding of how values are integrated into chart templates to dynamically generate Kubernetes resources.
Here is a basic ConfigMap
template from the Git repository at chapter6/examples/values-example/templates/configmap.yaml
:
apiVersion: v1 kind: ConfigMap metadata: name: values-example data: config.properties: |- chapterNumber={{ .Values.chapterNumber }} chapterName={{ .Values.chapterName }}
The last two lines of this template contain {{ .Values.chapterNumber }}
and {{ .Values.chapterName }}
actions, which are used as placeholders for the chapterNumber
and chapterName
values. This allows the ConfigMap to be parameterized based on the default chart values and the values the user provides during installation or upgrade.
Let’s take a look at the default chart...