Kapps can include golang templates to make it easy to use variables to configure the underlying commands that are executed for each run phase. For example, templating a Helm
values.yaml file makes it easy to configure the Helm chart dynamically with variables specific to the stack.
Each template is defined as:
source(required) - path to the source template. The path will be searched for first in the kapp (relative to the directory containing the kapp’s
sugarkube.yamlfile), then in any directories configured in the stack’s
dest(required) - the path to write the templated file to, relative to the kapp’s
conditions- a list of conditions that must all evaluate to
truefor the template to be rendered
conditions block allows you to only render templates in certain situations. As an example our Wordpress kapp only renders certain files when targetting AWS.
Sugarkube retemplates files multiple times during an installation/deletion. If you edit a rendered template it’s highly likely to be overwritten by a rerendered version, so make sure you do all your edits in the source template.