CLI options

Input

The minimum input that's required to trigger a policy check is to use the command datree test and to provide a Kubernetes configuration file path or a glob pattern:

Terminal

Flags

Flag

Alias

Values

Description

--help

-h

N/A

Prints help, if you give it a command then it will print help for that command. 

--output

-o

json, yaml, xml

Output the policy check results in the requested format

--output

-o

simple

Output the policy check results in simple text (without emoji or colors)

--schema-version

-s

e.g. "1.20.0"

Set Kubernetes version to validate against.

Defaults to 1.18.0 (default "1.18.0")

--ignore-missing-schemas

N/A

N/A

Skip files with missing schemas instead of failing the schema validation check

--policy

-p

e.g. staging

Specifying which policy to execute (by policy name)

--only-k8s-files

N/A

N/A

Skip all none K8s files.

Especially useful when scanning a dir with K8s and other config files:

datree test *.yaml --only-k8s-files