Display the rendered output of a specific template file
If you want to inspect the rendered output of a specific template file (e.g., when debugging a single resource) or multiple files, use the -s, --show-only=[]
flag. For example:
$ werf render -s .helm/charts/frontend/templates/deployment.yaml
---
# Source: demo-app/charts/frontend/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
meta.helm.sh/release-name: demo-app
meta.helm.sh/release-namespace: demo-app
...
Compute and display all service values
Sometimes you need to understand what service values
are passed to templates by werf. Use the werf helm get-autogenerated-values
command for this:
$ werf helm get-autogenerated-values
global:
werf:
name: demo-app
version: v2.36.4
werf:
commit:
date:
human: 2025-05-21 14:39:58 +0300 +0300
unix: 1747827598
hash: 577ec7a7caf4d5f94d5cf05df5c0fb74f5a8b6ac
image:
backend: REPO:TAG
frontend: REPO:TAG
is_stub: true
name: demo-app
namespace: demo-app
repo: REPO
stub_image: REPO:TAG
tag:
backend: TAG
frontend: TAG
version: v2.36.4
Special debug functions
The --debug-templates
flag enables advanced debugging mode for Go templates in werf.
In this mode:
- Some errors become more detailed, including additional context that is hidden in normal mode.
- Special functions for template debugging become available.
- It is possible to output debug information to the log without affecting the result of the templating.
️ Note: This verbose error behavior is enabled by default when
--debug-templates
is used, but it is not active in normal mode to avoid accidentally disclosing potentially sensitive data (such as secrets or internal values).
Below are scenarios where these functions can be useful and their behavior depending on the debug mode.
Log an arbitrary message
You can insert custom log messages at any point during templating using printf_debug
. This is useful for tracking variable values, condition execution, and the order of template rendering.
- With
--debug-templates
: the message is printed to the log and does not affect the rendering result; - Without
--debug-templates
: the function does nothing.
Example:
{{ printf_debug (printf "Current value: %v" .Values.someVar) }}
Log a dump of any structure
If you need to inspect a variable’s value — especially a complex one like .Values
or $
— use dump_debug
.
- With
--debug-templates
: the structure is logged in a human-readable format and does not affect the rendering result; - Without
--debug-templates
: the function does nothing.
Example:
{{ dump_debug $.Values.werf }}
Debug the include
function
To debug include
calls, replace them with include_debug
and enable template debug mode using --debug-templates
. This will log debug information about each include
invocation during templating.
- With
--debug-templates
: works likeinclude
, but also logs the template name, its content, and the rendered result; - Without
--debug-templates
: behaves like the standardinclude
.
Example:
{{ include_debug "my-template" . }}
Debug the tpl
function
To debug tpl
calls, replace them with tpl_debug
and enable template debug mode using --debug-templates
. This will log debug information about each tpl
invocation during templating.
- With
--debug-templates
: works liketpl
, but also logs the template string and the rendered result; - Without
--debug-templates
: behaves like the standardtpl
.
Example:
{{ tpl_debug "{{ .Values.env }}" . }}