This page describes a simple and fast way to deploy the Datadog Agent with the Operator. For more details on how to install the Operator and configure the Agent it deploys, refer to the installation guide.
Using the Datadog Operator requires the following prerequisites:
- Kubernetes Cluster version >= v1.20.X: Tests were performed on Kubernetes versions >=
1.20.0
. It is expected to work on versions>= v1.11.0
, but for earlier versions the Operator may not work as expected because of limited CRD support. - Helm for deploying the Datadog Operator
kubectl
CLI for installing the Datadog Agent
To deploy the Datadog Agent with the Operator using a minimum number of steps, use the datadog-operator
Helm chart.
-
Install the Datadog Operator:
helm repo add datadog https://helm.datadoghq.com helm install my-datadog-operator datadog/datadog-operator
-
Create a Kubernetes Secret with your API and application keys:
kubectl create secret generic datadog-secret --from-literal api-key=<DATADOG_API_KEY> --from-literal app-key=<DATADOG_APP_KEY>
Replace
<DATADOG_API_KEY>
and<DATADOG_APP_KEY>
with your Datadog API and application keys. -
Create a file with the spec of your
DatadogAgent
deployment configuration. The simplest configuration is:apiVersion: datadoghq.com/v2alpha1 kind: DatadogAgent metadata: name: datadog spec: global: credentials: apiSecret: secretName: datadog-secret keyName: api-key appSecret: secretName: datadog-secret keyName: app-key
-
Deploy the Datadog Agent with the above configuration file:
kubectl apply -f /path/to/your/datadog-agent.yaml
The configuration page lists all the Datadog Agent and Cluster Agent features and options that can be configured with the DatadogAgent
resource.
Visit the Integrations Autodiscovery page for details about how to configure Agent Integrations when using the Datadog Operator.
To change the default registry (gcr.io/datadoghq) to another registry, use the option spec.global.registry
.
The example datadog-agent-with-registry.yaml
file demonstrates how to configure the Operator to use the public.ecr.aws/datadog registry.
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
spec:
global:
registry: public.ecr.aws/datadog
# ...
The following command deletes all the Kubernetes resources created by the above instructions:
kubectl delete datadogagent datadog
helm delete my-datadog-operator