Skip to content

Commit 2ae383c

Browse files
Merge pull request #5 from eyarz/master
datree: Add datree CLI
2 parents ae30ae6 + 3ec947e commit 2ae383c

File tree

2 files changed

+42
-13
lines changed

2 files changed

+42
-13
lines changed

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ ARG KUBECONFORM_VERSION=0.4.7
3030
# https://github.com/Shopify/kubeaudit/releases
3131
ARG KUBEAUDIT_VERSION=0.14.0
3232

33+
# https://github.com/datreeio/datree/releases
34+
ARG DATREE_VERSION=0.1.382
35+
3336
# split layers into distinct components
3437
# Install yamllint and kubectl via the alpine packages repositories
3538
RUN apk add --no-cache --upgrade bash ca-certificates curl tar yamllint \
@@ -116,5 +119,14 @@ RUN mkdir /tmp/kube-linter \
116119
&& chmod +x /usr/local/bin/kube-linter \
117120
&& rm -rf /tmp/kube-linter
118121

122+
# Install Datree (https://github.com/datreeio/datree)
123+
RUN mkdir /tmp/datree \
124+
&& curl -L -o /tmp/datree/datree.zip \
125+
https://github.com/datreeio/datree/releases/download/${DATREE_VERSION}/datree-cli_${DATREE_VERSION}_Linux_x86_64.zip \
126+
&& unzip /tmp/datree/datree.zip -d /tmp/datree/ \
127+
&& mv /tmp/datree/datree /usr/local/bin \
128+
&& chmod +x /usr/local/bin/datree \
129+
&& rm -rf /tmp/datree
130+
119131
CMD ["/bin/bash"]
120132

README.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@ Ideally the kubeval-tools container should be used in a CI process to validate a
2323

2424
Tools List
2525
----------
26-
| Tool | Version | Purpose | Description |
27-
|-------------|---------|------------|-----------------------------------------------------------------------------------|
28-
| Kubectl | 1.21.1 | CLI | Kubernetes CLI. Can be used with `--dry-run=client` to validate manifests |
29-
| Yamllint | 1.26.0 | Linter | Basic linter for YAML files |
30-
| Kubeval | 0.16.1 | Validation | Tool for validating a Kubernetes YAML manifests. Doesn't work with CRDs. |
31-
| Kustomize | 4.1.0 | Compile | Template-free way to customize app configs. Useful to validate kustomize configs. |
32-
| Config Lint | 1.6.0 | Validation | Validate config files using custom rules specified in YAML. |
33-
| Conftest | 0.25.0 | Tests | Utility to help you write tests against structured configuration data. |
34-
| Kube Score | 1.11.0 | Security | Tool that performs **static code analysis** of Kubernetes object definitions. |
35-
| Polaris | 3.2.1 | Validation | Identifies Kubernetes deployment configuration errors |
36-
| Kube Linter | 0.2.1 | Security | Linter and Static analysis tool that checks Kubernetes manifests |
37-
| Kubeconform | 0.4.7 | Validation | Kubernetes manifests validation tool like Kubeval with CRD support |
38-
| Kubeaudit | 0.14.0 | Security | Audit clusters or manifest files for security concerns |
26+
| Tool | Version | Purpose | Description |
27+
|-------------|----------|------------|-----------------------------------------------------------------------------------|
28+
| Kubectl | 1.21.1 | CLI | Kubernetes CLI. Can be used with `--dry-run=client` to validate manifests |
29+
| Yamllint | 1.26.0 | Linter | Basic linter for YAML files |
30+
| Kubeval | 0.16.1 | Validation | Tool for validating a Kubernetes YAML manifests. Doesn't work with CRDs. |
31+
| Kustomize | 4.1.0 | Compile | Template-free way to customize app configs. Useful to validate kustomize configs. |
32+
| Config Lint | 1.6.0 | Validation | Validate config files using custom rules specified in YAML. |
33+
| Conftest | 0.25.0 | Tests | Utility to help you write tests against structured configuration data. |
34+
| Kube Score | 1.11.0 | Security | Tool that performs **static code analysis** of Kubernetes object definitions. |
35+
| Polaris | 3.2.1 | Validation | Identifies Kubernetes deployment configuration errors |
36+
| Kube Linter | 0.2.1 | Security | Linter and Static analysis tool that checks Kubernetes manifests |
37+
| Kubeconform | 0.4.7 | Validation | Kubernetes manifests validation tool like Kubeval with CRD support |
38+
| Kubeaudit | 0.14.0 | Security | Audit clusters or manifest files for security concerns |
39+
| Datree | 0.1.382 | Policy | Ensure Kubernetes manifests and Helm charts are valid and follow your policies. |
3940

4041
Kubeaudit
4142
---------
@@ -163,6 +164,22 @@ Kube Linter
163164

164165
[Kube Linter](https://github.com/stackrox/kube-linter) is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices. KubeLinter accepts YAML files as input and runs a series of checks on them. If it finds any issues, it reports them and returns a non-zero exit code.
165166

167+
Datree
168+
-----------
169+
170+
[Datree](https://github.com/datreeio/datree) is a CLI tool that can be used locally or in your CI/CD to ensure Kubernetes manifests and Helm charts follow best practices as well as your organization’s policies. It comes with 30 battle-tested rules to choose from, together with built-in support for YAML and kubernetes schema validation.
171+
172+
#### Example with static YAMLs
173+
```sh
174+
datree test my-app/*.yaml
175+
datree test my-app/deployment.yaml
176+
```
177+
178+
#### Example with Helm
179+
_First, you need to install [Datree's helm plugin](https://hub.datree.io/helm-plugin)_
180+
```sh
181+
helm datree test <CHART_DIRECTORY>
182+
```
166183

167184
Contributing
168185
------------

0 commit comments

Comments
 (0)