
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Deploy the Datadog Helm chart
/ 20
Add a toleration to the agent
/ 20
Change configuration values from the Helm chart
/ 20
Check the logs
/ 20
Enable the Cluster Agent
/ 20
This lab was developed with our partner, Datadog. Your personal information may be shared with Datadog, the lab sponsor, if you have opted-in to receive product updates, announcements, and offers in your Account Profile.
The Datadog Agent has many features. In this lab you will run the Datadog Agent in a Kubernetes cluster as a DaemonSet in order to start collecting your cluster and applications metrics, traces, and logs. You can deploy a Datadog Agent with a Helm chart or directly with a DaemonSet object YAML definition.
In this lab you will be explaining and using those options in a real cluster, checking in real time the features they enable.
In this lab you will learn about using the Helm chart used to install the Datadog Agent. You will learn how to:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.
This Qwiklabs hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Note: If you already have your own personal Google Cloud account or project, do not use it for this lab.
Note: If you are using a Pixelbook, open an Incognito window to run this lab.
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is a panel populated with the temporary credentials that you must use for this lab.
Copy the username, and then click Open Google Console. The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Open the tabs in separate windows, side-by-side.
In the Sign in page, paste the username that you copied from the Connection Details panel. Then copy and paste the password.
Important: You must use the credentials from the Connection Details panel. Do not use your Qwiklabs credentials. If you have your own Google Cloud account, do not use it for this lab (avoids incurring charges).
Click through the subsequent pages:
After a few moments, the Cloud Console opens in this tab.
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
In the Cloud Console, in the top right toolbar, click the Activate Cloud Shell button.
Click Continue.
It takes a few moments to provision and connect to the environment. When you are connected, you are already authenticated, and the project is set to your PROJECT_ID. For example:
gcloud
is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
You can list the active account name with this command:
(Output)
(Example output)
You can list the project ID with this command:
(Output)
(Example output)
Next, set up a Datadog Trial account to use in the lab. If you already have a trial account set up, you can use that. It is recommend that you do not use your production Datadog account to avoid cluttering the environment with test and training assets.
Navigate to the Datadog sign up page and enter your name, email, company, and a password.
Next, select your software stack. In this lab you will be using Google Cloud Platform and Kubernetes, then click Next.
On the next page, you will see a list of available Agent installations.
Click Kubernetes.
Select Helm Chart as the Installation Method.
In Add the Datadog Helm Repository, click on the api-key
value to reveal it. This will bring up a window where you need to select an existing API key or create a new one. Click Use API key.
Click on the api-key
box to see the Datadog API Key. Copy it to your clipboard.
Back in the Cloud Console, navigate back to your Cloud Shell window.
Run the following command, replacing <YOUR_DATADOG_API_KEY>
with your API key in the appropriate slot:
You should see:
In this section, you will deploy the Datadog Helm chart without any additional options. When that happens, the Helm chart will get deployed with the default values.yaml
that comes with the chart. You can check these default values in the Helm chart Github repository.
Click Check my progress to verify the objective.
You should get an output similar to this:
The most important one is the one called datadog
. This is a secret that was automatically created that contains your API key.
The other two token
secrets are the ones used by the service accounts to communicate with the API server.
The Datadog Helm chart, by default, aside from the Datadog agent, deploys Kube State Metrics by default. Kube State Metrics is a service that listens to the Kubernetes API and generates metrics about the state of the objects. Datadog uses some of these metrics to populate its Kubernetes default dashboard.
This is the Daemonset that deploys the Datadog node agent. To be able to gather information from the Kubelet and system metrics from each of the nodes, the Datadog node agent deploys at least 1 node agent pod per node.
You should get an output similar to this one:
The Datadog node agent was deployed to the two worker nodes. If you were running a Kubernetes cluster outside of the Google Kubernetes Engine, you would have a control plane node but the agent wouldn’t be installed there. Why?
There is a taint in the control plane node that prevents pods without the corresponding toleration being scheduled in that node:
If you want to monitor the control plane nodes, you need to add a toleration for the control-plane nodes. The next step will explain how.
As mentioned before, the cluster has two nodes because you are running in the Google Kubernetes Engine. On other platforms you would also have a control plane node. In those cases, the agent would only be deployed to the worker nodes. This section shows you what you would have to do to add a toleration to allow the agent to be installed on the control plane. This is fairly easy to do using the Datadog Helm chart, as there is a specific section in the values.yaml
file to add tolerations.
Click the Open Editor button on the toolbar of Cloud Shell. (You can switch between Cloud Shell and the code editor by using the Open Editor and Open Terminal icons as required, or click the Open in new window button to leave the Editor open in a separate tab).
In the Editor, navigate to dd-helm-chart-values/values.yaml
.
Around line 1071, find the following lines:
You have a values-tolerations.yaml
file already with that section.
helm upgrade
command. Again, since you are running this on GKE (Google Kubernetes Engine), there isn’t a control plane node that you can access.Click Check my progress to verify the objective.
Explore how to change some configuration values from the Helm chart. When installing Kubernetes from scratch, there are hundreds of potential configuration choices. As a result, setting up the agent isn’t always perfect the first time. For example, suppose there was an issue with the Kubelet.
You could run the agent status command in the Datadog's agent pod running in the worker node to try to determine what the problem is.
Say you are getting this error:
That error happens because you cannot verify the Kubelet certificates correctly. It’s pretty common in development clusters since getting the certificates is a multi-step process and not entirely needed in non-production environments. To solve this you would tell the Datadog agent to skip the TLS verification by setting the environment variable called DD_KUBELET_TLS_VERIFY
to false
.
values.yaml
file is easy: there is a section to do just that:You have a values-kubelet.yaml
file already with that section.
Click Check my progress to verify the objective.
For this particular example, the Kubelet check would now run now successfully.
Logs collection is disabled by default in the Datadog Helm chart default values.
You should see the following:
values.yaml
(around line 217) file to enable log collection easily:enabled
and containerCollectAll
to true, to enable log collection and to collect logs from all containers in the cluster.You have a values-logs.yaml
file already with that section.
Click Check my progress to verify the objective.
Log collection should be enabled now:
The APM (tracing) agent is also disabled by default in the Datadog Helm chart default values.
You should get the following:
values.yaml
file (around line 240) to enable APM easily:enabled
and useSocketVolume
to true.You have a values-apm.yaml
file already with that section.
Log collection should be enabled now:
Right now you have deployed Datadog's node agent. A Daemonset that ensures at least 1 replica per node in our cluster.
Another type of Datadog's Kubernetes agent is the Cluster Agent, that acts a proxy between the API server and the agents, and provides cluster level monitoring data.
The Cluster Agent is disabled by default in the Datadog Helm chart default values and in this environment since you don’t have access to the control plane you aren’t able to completely install it. But depending on where you run Kubernetes you may have to monitor the control plane. There is a section in the values.yaml
file to enable the Cluster Agent and to set the number of replicas:
To enable the Cluster Agent, around line 457 change enabled
to true.
You have a values-cluster-agent.yaml
file already with that section. You can check the difference between the previous applied values file:
Click Check my progress to verify the objective.
The resulting output would look similar to this one:
status
command in the Cluster Agent pod:And you would see something like this:
In this lab you got hands-on experience using the Datadog Helm Chart and installed the Datadog Agent.
Be sure to check out the following labs for more practice with Datadog:
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated May 14, 2024
Lab Last Tested October 3, 2023
Copyright 2024 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one