Helm Templates: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 13: Line 13:
=The templates/ Directory=
=The templates/ Directory=


The 'templates' directory contains templates that, after combination with [[Helm_Concepts#Values_and_Chart_Configuration|values]], will the Kubernetes manifests. <font color=darkgray>Files whose names start with "_" or "." will be ignored. - Really? helm install complained about _pod.yaml.</font>
The 'templates' directory contains templates that, after combination with [[Helm_Concepts#Values_and_Chart_Configuration|values]], will the Kubernetes manifests. When Tiller evaluates a chart, it will send all of the files in the directory through the template rendering engine, then collect the results and send them to to Kubernetes.
 
<font color=darkgray>Files whose names start with "_" or "." will be ignored. - Really? helm install complained about _pod.yaml.</font>


=Built-in Objects=
=Built-in Objects=

Revision as of 02:15, 29 August 2019

External

Internal

Overview

Templates are files living under a chart's templates/ directory. They are written in YAML with Helm templates extensions. Upon processing by Helm, they become Kubernetes manifest files. Helm template extensions are written in the Help template language, which is based on Go templates.

The templates/ Directory

The 'templates' directory contains templates that, after combination with values, will the Kubernetes manifests. When Tiller evaluates a chart, it will send all of the files in the directory through the template rendering engine, then collect the results and send them to to Kubernetes.

Files whose names start with "_" or "." will be ignored. - Really? helm install complained about _pod.yaml.

Built-in Objects

Built-in Objects

Chart

Exposes all contents of Chart.yaml. An existing field is available as (note leading dot) .Chart.<UpperCasedFirstLetterFieldName>.

Example:

{{ .Chart.Name }}
{{ .Chart.Version }}

Values

Release

Release.Name

Exposes the release name:

{{ .Release.Name }}

Release.Revision

Exposes the release revision:

{{ .Release.Revision }}

Release.Time

Exposes the time of the release:

{{ .Release.Time }}

Release.Namespace

Exposes the namespace to be released info, if the manifest does not override:

{{ .Release.Namespace }}

Release.IsUpgrade

This is set to true if the current operation is an upgrade or rollback.

{{ .Release.IsUpgrade }}

Release.IsInstall

This is set to true if the current operation is an install.

{{ .Release.IsInstall }}

Release.Service

Exposes the releasing service - always Tiller

Files

Capabilities

Template

TODO

Template Comments

# This is a comment
{{- /*
This is another comment
*/ -}}

TODO