7

Helm: Dry Run & Template Debug

 1 year ago
source link: https://www.shellhacks.com/helm-dry-run-template-debug/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Helm uses a packaging format called charts (a collection of Kubernetes resource files).

This note shows how to --dry-run and --debug Helm chart templates with examples.

It also shows how to lint and render Helm chart YAMLs locally (without sending them to a Kubernetes API server).

Cool Tip: List Helm charts and repositories using a helm command! Read more →

Helm: Dry Run & Template Debug

Use the --dry-run and --debug options with the helm install command to test a Helm chart template rendering without actually installing anything:

$ helm install <chartName> <repoName>/<chartPath> --dry-run --debug
- example -
$ helm install nginx-ingress nginx-stable/nginx-ingress --dry-run --debug

The command above will send the chart to the tiller (the server portion of Helm, that typically runs on a Kubernetes cluster), which will render the template.

But instead of installing the chart, the command above will just print the rendered template.

If you are not connected to the Kubernetes cluster you may receive an error as follows:

Error: INSTALLATION FAILED: Kubernetes cluster unreachable: Get “http://localhost:8080/version”: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

Cool Tip: How to download a Helm chart and save it locally! Read more →

To debug the Helm chart templates without sending them to a Kubernetes API server, you can download the chart and render it locally using the following command:

$ helm template <chartFolder|chartArchive>
- examples -
$ helm template ./nginx-ingress
$ helm template nginx-ingress-0.15.2.tgz

You can also lint the Helm chart to verify its validity and that it follows the best practices:

$ helm lint <chartFolder|chartArchive>
- examples -
$ helm lint ./nginx-ingress
$ helm lint nginx-ingress-0.15.2.tgz

Happy Helm chart templates debugging!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK