Helm plugin

Document image

Helm plugins are add-on tools that integrate seamlessly with Helm. They provide a way to extend the core feature set of Helm. Therefore, Datree's Helm plugin can be accessed through the helm CLI, to provide a seamless experience to Helm users.

Install Datree's Helm plugin

Terminal

Trigger datree policy check via the helm CLI

Terminal

Passing arguments

You can pass CLI arguments normally. For example:

Terminal

To pass helm arguments to your template, you will need to add -- before them:

Terminal

Using other helm command

Helm might be installed through other tooling like microk8s. The DATREE_HELM_COMMAND allows specifying a command to run helm (default is helm):

Terminal

Usage example

Terminal
helm datree output
helm datree output

Troubleshooting

K8s schema validation error

This error occurs when trying to scan Chart.yaml or values.yaml files instead of the chart directory.

Solution: Pass the helm chart directory path to Datree's CLI, instead of to the file itself:

  • Correct - `helm datree test examples/helm-chart/nginx`
  • Wrong - `helm datree test examples/helm-chart/nginx/values.yaml`

The policy check returns false-positive results

The best way to determine if a false-positive result is a bug or a true misconfiguration, is by rendering the Kubernetes manifest with helm and then checking it manually:

Terminal

If after eyeballing the rendered manifest you still suspect it's a bug, please open an issue here.

Running in CI

When running the Helm plugin in the CI, you will need to connect the plugin to your configured policy. To do that, you will need to add your account token as an environment variable or include it when calling the Datree CLI.