How do I install the Datadog Kubernetes logging agent?

Last updated: May 29, 2025

Context

To monitor and collect logs from your Kubernetes cluster using Datadog, you need to install their logging agent using Helm charts. This requires executing several commands to add the Datadog repository, install the operator, and configure the necessary credentials.

Answer

To install the Datadog Kubernetes logging agent, you'll need to:

  1. Connect to your cluster using an admin kubeconfig file over VPN. Note that using the kubectl shell from the dashboard won't have sufficient admin privileges.

  2. Once connected, run the following commands in sequence:

    helm repo add datadog https://helm.datadoghq.com
    helm install datadog-operator datadog/datadog-operator
    kubectl create secret generic datadog-secret --from-literal api-key=YOUR_API_KEY
    

Important: The kubectl shell available through the web portal does not have admin privileges required for this installation. You must use a local kubectl configuration with admin access connected through VPN.