helm dry run install

KubernetesKubernetes Helm

Kubernetes Problem Overview


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.

Kubernetes Solutions


Solution 1 - Kubernetes

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.

Solution 2 - Kubernetes

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.

Solution 3 - Kubernetes

There is a small diff between helm install --dry-run and helm 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.

  • helm 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!

Solution 4 - Kubernetes

Use Helm template or helm lint instead.

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsfgroupsView Question on Stackoverflow
Solution 1 - KubernetesEldad AssisView Answer on Stackoverflow
Solution 2 - KubernetesJose ArmestoView Answer on Stackoverflow
Solution 3 - KubernetesKalpesh ChaudhariView Answer on Stackoverflow
Solution 4 - KubernetesMichael GeorgeView Answer on Stackoverflow