Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the order of execution of the yamls in the helm templates/ directory?

I am a helm/tiller rookie. My chart directory looks like:

$ helm create mychart

$ tree mychart
mychart
├── Chart.yaml
├── templates
│   ├── daemonset.yaml
│   ├── ingress.yaml
│   ├── ingress_external.yaml
│   ├── ingress_path.yaml
│   ├── rbac.yaml
│   └── service.yaml
└── tests
    ├── daemonset_test.yaml
    ├── ingress_external_test.yaml
    ├── ingress_test.yaml
    └── service_test.yaml

On doing an install of this chart, is the order of execution of the templates well-defined or are the yaml files under templates/ directory executed in a non-deterministic order? Are the templates executed in alphabetical order?

Thank you.

like image 833
user674669 Avatar asked May 18 '19 00:05

user674669


People also ask

What does {{ }} mean in Helm?

The Helm template syntax is based on the Go programming language's text/template package. The braces {{ and }} are the opening and closing brackets to enter and exit template logic.

What does the Helm Template command do?

The templates directory contains templates that generate Kubernetes manifest files when combined with values. NOTE: As Helm evaluates a chart, the files inside the templates directory will be processed in a template rendering engine before being sent to Kubernetes.

What is Helm chart template?

Helm uses a packaging format called charts. A chart is a collection of files that describe a related set of Kubernetes resources. A single chart might be used to deploy something simple, like a memcached pod, or something complex, like a full web app stack with HTTP servers, databases, caches, and so on.


1 Answers

Order was added in v3.1.0

  // expectation is sorted by kind (unknown is last) and within each

group of same kind, the order is kept {"cm,clusterRole,clusterRoleBinding,Unknown,Unknown2", InstallOrder, "01aAz!u2u1t3"},

https://github.com/helm/helm/pull/6842/commits/4d8160eedf43db8ed137

like image 171
Jammarra Avatar answered Nov 15 '22 11:11

Jammarra