47
votes

I am trying to test my development helm chat deployment output using --dry-run option. when I run the below command its trying to connect to Kubernetes API server.

Is dry run option required to connect Kubernetes cluster? all I want to check the deployment yaml file output.

helm install mychart-0.1.0.tgz --dry-run --debug

Error: Get http://localhost:8080/api/v1/namespaces/kube-system/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.
4
Here is really good youtube tutorial for understanding the helm dry run install - youtu.be/gb5nYiWAIUsRahul Wagh

4 Answers

59
votes

As stated on Helm's documentation

When you want to test the template rendering, but not actually install anything, you can use helm install --debug --dry-run ./mychart. This will send the chart to the Tiller server, which will render the templates. But instead of installing the chart, it will return the rendered template to you so you can see the output

So it still needs to connect to Tiller to render your templates with the right values. The difference when using the --dry-run option is that it won't actually install the chart.

85
votes

There is also an option to run helm template ./mychart to render the generated YAMLs without needing the connection to tiller. Combined with helm lint it's a great set to verify validity of your chart.

9
votes

There is a minor diff between the helm install helm install --dry-run and help template command:

  • helm install --dry-run will send your chart to the tiller which will verify and render the manifest files against the K8S specs along with the YAML validations.

  • help template will only generate the manifest and verify if your YAML file is valid. However, it won't check if the generated manifests are valid Kubernetes resources. Ref: Helm Docs

Hope this helps!

0
votes

Use Helm template or helm lint instead.

helm lint is your go-to tool for verifying that your chart follows best practices.