INTRODUCTION

This article provides a step-by-step guide on integrating Datadog with Kubernetes using Helm. Datadog is a robust monitoring and analytics platform that can provide valuable insights into the performance and health of your Kubernetes clusters. Helm is a Kubernetes package manager that simplifies installing, upgrading and managing apps on a cluster.

datadog helm chart

The workflow of data collection in Datadog, when integrated with Kubernetes, involves deploying the Datadog Agent as a DaemonSet in the cluster to collect metrics and traces from the host and pods, forwarding the collected data to the Datadog platform via the Datadog Cluster Agent, which is a Kubernetes deployment that runs in the cluster and provides features like service discovery, pod tagging and then the data is processed and can be visualized in dashboards, used to trigger alerts, and analyzed for troubleshooting and monitoring purposes.

Integrating Datadog with Kubernetes using Helm

The process of integrating Datadog with Kubernetes using Helm involves several steps, including:

  • Installing Helm on your system
  • Adding the Datadog Helm repository to your local Helm configuration
  • Installing the Datadog chart in your Kubernetes cluster using Helm
  • Configuring the installed Datadog chart to connect to your Datadog account by creating a secret containing your Datadog API and application keys
  • Verifying the installation by running the “kubectl get pods” command
  • Enabling autodiscovery in Datadog by editing the config map.

datadog helm chart

Step 1: Install Helm

WHAT IS HELM?

Helm is a package manager for Kubernetes, an open-source container orchestration system. Helm simplifies managing and deploying applications on a Kubernetes cluster by providing a simple and consistent way to define, install, and upgrade applications. In addition, it provides a command-line interface for interacting with Kubernetes and can be used to manage and automate the deployment of complex applications. Helm employs a chart packaging format, a collection of Kubernetes resources that have been grouped and can be handled as a single unit.

Community members can create and share charts and information on configuring and deploying a specific application or service. Helm also provides a repository to store and share charts.

In summary, Helm is a tool that makes it easy to manage and deploy applications on a Kubernetes cluster by providing a simple and consistent way to define, install, and upgrade applications using charts, which are collections of Kubernetes resources that can be managed as a separate unit.

How to install Helm on your system?

Installing Helm on your system is a straightforward process that involves downloading the Helm binary and adding it to your system’s PATH. Here are the general instructions for installing Helm on different operating systems:

  • macOS:
    You can install Helm on macOS using the package manager Homebrew. First, you must install Homebrew if you still need to do so. Once you have Homebrew installed, you can install Helm by running the following command:
    “Brew install Helm”
  • Windows:
    You can install Helm on Windows by downloading the Helm binary from the Helm website (https://github.com/helm/helm/releases/) and adding it to your system’s PATH. Once you have downloaded the binary, you need to extract it to a directory in your system’s PATH (e.g., C:\Windows\System32).
  • ubuntu:
    To install Helm on Ubuntu, follow these steps:* Add the Helm repository to your system: 
Copy to Clipboard

* Update your package index and install Helm:

Copy to Clipboard

Verification of Helm installation

Once you have completed the above steps, you can verify that Helm is installed by running the command 

$ helm version
which will show the Helm version installed on your system.

Note: before running any helm command, make sure you have a Kubernetes cluster running and kubectl is configured to point to the running cluster, and you can run kubectl commands.

Step 2: Add the Datadog Helm Repository

Why is adding the Datadog Helm repository necessary?

Adding the Datadog Helm repository is necessary because it allows you to access the Datadog chart, a pre-configured package containing all the necessary Kubernetes resources to deploy and configure Datadog on your cluster. Helm uses repositories to store and distribute charts, so adding the Datadog Helm repository gives you access to the Datadog chart, which can be easily installed using Helm commands.

When you run the command-

Copy to Clipboard

it adds the Datadog Helm repository to your local Helm configuration, so you can use Helm to install the Datadog chart. This is necessary because it tells Helm where to find the chart, so it knows where to download it from 

when you run the command-

Copy to Clipboard

Helm repositories also provide versioning for charts, so you can specify a specific version of a chart to install or use the latest version of a chart if you don’t specify a version. This is useful when you want to deploy new features or bug fixes without affecting the currently running services in the cluster.

In summary, adding the Datadog Helm repository is necessary because it gives you access to the Datadog chart, a pre-configured package containing all the necessary Kubernetes resources to deploy and configure Datadog on your cluster. It also allows you to specify a specific version of the chart to install, providing versioning and keeping track of different versions of the graph.

NOTE

The above commands need additional options to work which are given in the following steps.

Step 3: Install and configure the Datadog Chart

You can use the Helm package manager to install and configure the Datadog Chart for Datadog. Here are the steps to do this:

Create values.yaml file to configure the chart. This file should contain your Datadog API key and any other custom values you want to set for the chart.

Install the chart using the values.yaml file:

Copy to Clipboard

Example:

Copy to Clipboard

Where <RELEASE_NAME> is the name you want to give to the release.

Verify that the Datadog Agent is running:

Copy to Clipboard

Where <NAMESPACE> is the namespace where you installed the chart.

Verify that the Agent is reporting to Datadog:

Go to your Datadog account and check if the Agent is reporting metrics and traces.

Make sure to replace the <RELEASE_NAME> , <DATADOG_API_KEY> and <NAMESPACE> with the appropriate values.

Note: The above steps are for basic installation for more advanced installation and configuration; you can refer to the data dog chart documentation and the datadog website for more information.

Step 4: Verify Installation

To verify that the Datadog chart is installed and running correctly, you can use the command

Copy to Clipboard

to list all the releases that are currently installed on your cluster. The output of this command will show the release’s name, the chart it was deployed from, and the status of the release.

To verify the status of the pods created by the Datadog chart, run the command

Copy to Clipboard

This command will show the name of the pods, their current state, and the number of restarts.

If the chart is installed correctly, the output of this command should show that the services are deployed and running.

Additionally, you can use the command

Copy to Clipboard

to check the status of the benefits created by the Datadog chart. This command will show the services’ name, type, and cluster IP.

Also, you can use the command

Copy to Clipboard

to check the logs of the datadog-agent pod to make sure that the Agent is running correctly and communicating with the Datadog API.

datadog helm chart

CONCLUSION

In conclusion, this article provided an overview of integrating Datadog with Kubernetes using Helm. Helm is a package manager for Kubernetes that simplifies managing and deploying applications on a Kubernetes cluster. By adding the Datadog Helm repository and installing the Datadog chart, you can quickly deploy and configure Datadog on your cluster.

The article covered how to install Helm, add the Datadog Helm repository, and install the Datadog chart using Helm commands. It also provided instructions on verifying that the graph is installed and running correctly by using commands such as helm list, kubectl get pods, kubectl get services, and kubectl logs, etc. 

Integrating Datadog with Kubernetes using Helm provides several benefits, such as:

  • Having a centralized monitoring and observability solution for your entire Kubernetes infrastructure,
  • Ability to quickly scale up or down the number of Datadog agents to match the scale of your cluster,
  • Automatic collection of Kubernetes metrics and events,
  • Ability to easily update and roll back the Datadog agent version.
  • Helm makes it easy to deploy and manage Datadog on a Kubernetes cluster, providing improved visibility and control over your infrastructure.