Helm Template Function Default

From NovaOrdis Knowledge Base
Revision as of 07:45, 25 June 2020 by Ovidiu (talk | contribs) (→‎Overview)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

External

Internal

Overview

{{ default <default-value> <actual-value> }}
{{ default "blue" .Values.color }}
metadata:
  name: {{ .Values.myApp.clusterRole | default "my-app:cluster-role" | quote }}

In an actual chart, all static default values should live in the values.yaml, and should not be repeated using the default command - if that happens, we will have redundantly specified values. However, the default is useful for computed values, which cannot be declared inside values.yaml.