Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to render only selected template in Helm?

I have ~20 yamls in my helm chart + tons of dependencies and I want to check the rendered output of the specific one. helm template renders all yamls and produces a hundred lines of code. Is there a way (it would be nice to have even a regex) to render only selected template (by a file or eg. a name).

like image 450
sacherus Avatar asked Jul 29 '20 15:07

sacherus


People also ask

What is $_ in Helm?

The $_ is used to suppress undesired output as "set" returns the new dictionary.

What is TPL function in Helm?

The tpl function allows developers to evaluate strings as templates inside a template. This is useful to pass a template string as a value to a chart or render external configuration files. Syntax: {{ tpl TEMPLATE_STRING VALUES }}

What does {{- mean in Helm?

{{- (with the dash and space added) indicates that whitespace should be chomped left, while -}} means whitespace to the right should be consumed. Be careful!

What is _helper TPL in Helm?

These files are used to store partials and helpers. In fact, when we first created mychart , we saw a file called _helpers. tpl . That file is the default location for template partials.


1 Answers

From helm template documentation

-s, --show-only stringArray only show manifests rendered from the given templates

For rendering only one resource use helm template -s templates/deployment.yaml .

like image 161
edbighead Avatar answered Oct 20 '22 00:10

edbighead