Helm Template Function Default: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 12: Line 12:
  {{ default "blue" .Values.color }}
  {{ default "blue" .Values.color }}


In an actual chart, all static default values should live in the [[Helm_Chart_values.yaml|values.yaml]], and should not be repeated using the default command (otherwise they would be redundant).
In an actual chart, all static default values should live in the [[Helm_Chart_values.yaml|values.yaml]], and should not be repeated using the default command - if that happens, we will have redundantly specified values. However, the <tt>default</tt> is useful for computed values, which cannot be declared inside [[Helm_Chart_values.yaml|values.yaml]].

Revision as of 04:40, 29 August 2019

External

Internal

Overview

{{ default <default-value> <actual-value> }}
{{ default "blue" .Values.color }}

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.