I want to export already templated Helm Charts as YAML files. I can not use Tiller on my Kubernetes Cluster at the moment, but still want to make use of Helm Charts. Basically, I want Helm to export the YAML that gets send to the Kubernetes API with values that have been templated by Helm. After that, I will upload the YAML files to my Kubernetes cluster.
I tried to run .\helm.exe install --debug --dry-run incubator\kafka
but I get the error Error: Unauthorized
.
Note that I run Helm on Windows (version helm-v2.9.1-windows-amd64).
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. yaml.
Kustomize is a command-line tool that can create and transform YAML files — just like yq .
While there're a lot of tools to template Kubernetes YAML files, Helm caught a lot of attention very early on and established itself as the market leader. Helm is a convenient templating engine: it uses the Go templating engine and the helpers from the Sprig library.
We need logs to check the Unauthorized
issue.
But you can easily generate templates locally:
helm template mychart
Render chart templates locally and display the output.
This does not require Tiller. However, 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.
More info: https://helm.sh/docs/helm/helm_template/
Amrit Bera's solution will only work with local helm chart, per the details of your question you want it to work with remote helm chart, that's a feature that will be added to Helm v3 (Work in Progress currently).
RehanSaeed posted the following workaround (https://github.com/helm/helm/issues/4527)
Basically:
mkdir yamls helm fetch --untar --untardir . 'stable/redis' #makes a directory called redis helm template --output-dir './yamls' './redis' #redis dir (local helm chart), export to yamls dir
The good thing about this is you can mix this technique with weaveworks flux for git ops + this gives you another option for using Helm v2 without tiller, in addition to the Tiller Plugin (which lets you run tiller locally, but doesn't work smoothly).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With