Introduction to Datree

Prevent Kubernetes misconfigurations from going into production

Let's say you are DevOps Engineer, who is managing Kubernetes clusters and wants the team to follow certain rules while writing Kubernetes configuration files, which follow the best practices. You can achieve this using Datree and prevent Kubernetes misconfiguration from reaching production

Datree is an open-source easy-to-use command line tool that can be used to check for errors in the Kubernetes configuration files before deploying. Let's get started!

Installation

  1. Go to https://app.datree.io/, create your account and log in.
  2. Open the terminal on your machine and run the below command to install datree
    curl https://get.datree.io | /bin/bash
    
  3. You can connect your datree dashboard with your local environment using the following command. Get your token from the settings page after you login.
    datree config set token <token>
    

Editing YAML file

Datree provides us with a demo k8s config file, that we can use to play around with datree. To test the demo file, run:

datree test ~/.datree/k8s-demo.yaml

On running the above command, you will see a result something like this:

Screenshot 2022-07-16 203412.png

That's it to guys get started with datree. You can now test any configuration file with datree. You can definitely playaround with this demo file, and the datree's dashboard to add new policies, toggle rules, etc.

Happy learning!