Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View template files of Helm chart

With helm inspect [CHART] I can view the content of chart.yaml and values.yaml of a chart. Is there a way to also view the template files of a chart? Preferably through a Helm command.

On a sidenote: this seems like a pretty important feature to me. I would always want to know what the chart exactly does before installing it. Or is this not what helm inspect was intended for? Might the recommended way be to simply check GitHub for details how the chart works?

like image 795
Nicky Muller Avatar asked May 03 '18 10:05

Nicky Muller


People also ask

How do I find my Helm template?

If you want to check the templates for given chart you can use helm template [chartname] command. The docs describe it as : Render chart templates locally and display the output. Any values that would normally be looked up or retrieved in-cluster will be faked locally.

Where are Helm templates stored?

All template files are stored in a chart's templates/ folder. When Helm renders the charts, it will pass every file in that directory through the template engine.

How do I get YAML file from Helm chart?

You can use the helm native commands to achieve this. In helm, there is a command called helm template . Using the template command you can convert any helm chart to a YAML manifest. The resultant manifest file will have all the default values set in the helm values.


2 Answers

you can use helm fetch if you want to download the whole chart:

download a chart from a repository and (optionally) unpack it in local directory

(from the doc)

helm inspect returns the default values.yaml for the chart:

This command inspects a chart and displays information. It takes a chart reference ('stable/drupal'), a full path to a directory or packaged chart, or a URL.

Inspect prints the contents of the Chart.yaml file and the values.yaml file.

(from the doc)

like image 160
Omer Levi Hevroni Avatar answered Oct 07 '22 02:10

Omer Levi Hevroni


If you want to check the templates for given chart you can use helm template [chartname] command.

The docs describe it as :

Render chart templates locally and display the output.

Any values that would normally be looked up or retrieved in-cluster will be faked locally. Additionally, none of the server-side testing of chart validity (e.g. whether an API is supported) is done.

like image 40
Michał Krzywański Avatar answered Oct 07 '22 04:10

Michał Krzywański