Difficulty: Beginner
Estimated Time: 10 minutes

Creating a Kubernetes Cluster

In this workshop, we'll create a kubernetes cluster, and add Datadog along with Autodiscovery to grab metrics and logs from the applications within.

To work in, we'll spin up a two node cluster. It may take a minute or two for your cluster to initialize.

Adding Autodiscovery

Autdiscovery works in kubernetes with annotations. Annotations allow us to add information to our existing services.

Kubernetes Autodiscovery

Step 1 of 3

Step 1

Deploying Our Application to Kubernetes

The workshop already has an application ready to be deployed to kubernetes included.

First, ensure your kubernetes cluster has been initialized, and both nodes have been added. You can do this by running kubectl get nodes in host1.

On host1, change into the YAML file directory with a cd k8s-yaml-files. You should be able to ls and see the YAML files for every service we plan on running in our cluster.

First, add your Datadog API key to the secrets. You can do this with a:

$ kubectl create secret generic datadog-api --from-literal=token=<YOUR_DATADOG_API_KEY>

Once that's done, we'll next need to create a secret username and password for our PostgreSQL database.

$ kubectl create secret generic postgres-user --from-literal=token=postgres
$ kubectl create secret generic postgres-password --from-literal=token=<YOUR_PASSWORD>

Finally, spin up the Datadog Agent container, so we can see our Nodes in the Datadog app:

$ cd k8s-yaml-file/
$ kubectl apply -f datadog-agent.yaml

You should now be able to see your cluster inside of Datadog. Verify this before continuing on to the next step.