Debugging Templates
Debugging templates can be tricky because the rendered templates are sent to theKubernetes API server, which may reject the YAML files for reasons other thanformatting.
There are a few commands that can help you debug.
helm lint
is your go-to tool for verifying that your chart follows bestpracticeshelm install —dry-run —debug
orhelm template —debug
: We’ve seen thistrick already. It’s a great way to have the server render your templates,then return the resulting manifest file.helm get manifest
: This is a good way to see what templates are installed onthe server.When your YAML is failing to parse, but you want to see what is generated, oneeasy way to retrieve the YAML is to comment out the problem section in thetemplate, and then re-runhelm install —dry-run —debug
:
apiVersion: v2
# some: problem section
# {{ .Values.foo | quote }}
The above will be rendered and returned with the comments intact:
apiVersion: v2
# some: problem section
# "bar"
This provides a quick way of viewing the generated content without YAML parseerrors blocking.