Build a Complex Helm Chart
Learn how to reuse named templates in multiple Kubernetes resource definitions.
We'll cover the following
Template pipelines
In Helm, we can chain multiple commands such that the result of the previous command is used as the argument of the following one. This operation is known as the concept of pipelines and can be applied to any operation between {{ }}
signs. For example, when we want to inject a property from the values.yaml
file and make sure that it’s always written in uppercase, we can define it as something like this: {{ .Values.app.name | upper }}
. The upper
command takes the value from the previous step and produces output with uppercase letters. To separate two or more commands we’re using the pipe (|
) character.
Moving back to our case, we need to add a command after adding a named template that will add four whitespace characters. To achieve it we can use an indent
command, as follows:
Get hands-on with 1400+ tech skills courses.