Deploy Datadog Operator and DatadogAgent on SleakOps
Install the Datadog Operator and deploy a DatadogAgent custom resource on a SleakOps EKS cluster to enable APM, log collection, and Kubernetes event monitoring.
This guide was tested with DatadogOperator v2.8.0 and DatadogAgent v7.63.3.
Prerequisites
In the cluster:
- Create the
datadognamespace - Create the
datadog-secretSecret containing your Datadog API key:
kubectl create secret generic datadog-secret \
--from-literal=api-key=<YOUR_DATADOG_API_KEY> \
-n datadog
Optional but recommended: Create a dedicated NodePool for Datadog (e.g., datadog-app). If you use a dedicated NodePool, workloads you want to monitor must also run on that NodePool.
Step 1 — Deploy the Datadog Operator
helm upgrade -i datadog datadog/datadog-operator \
--namespace datadog \
--create-namespace \
--set "tolerations[0].key=karpenter.sh/nodepool" \
--set "tolerations[0].operator=Equal" \
--set "tolerations[0].value=<NODEPOOL-NAME>"
Replace <NODEPOOL-NAME> with your NodePool name (e.g., datadog-app-amd).
Step 2 — Prepare Workloads for Instrumentation
Add these annotations/labels to the Deployment spec of each workload you want Datadog to instrument:
spec:
template:
metadata:
labels:
admission.datadoghq.com/enabled: "true"
annotations:
admission.datadoghq.com/js-lib.version: v5.45.0
In the workload's Var Group, add:
DD_LOGS_ENABLED=true
DD_LOGS_INJECTION=true
DD_ENV=<your-env>
DD_SERVICE=<your-service-name>
Step 3 — Deploy the DatadogAgent
Create datadogagent.yaml:
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
namespace: datadog
spec:
global:
clusterName: <CLUSTER-NAME>
site: datadoghq.com # see https://docs.datadoghq.com/getting_started/site/
credentials:
apiSecret:
secretName: datadog-secret
keyName: api-key
features:
admissionController:
enabled: true
mutateUnlabelled: false
apm:
enabled: true
hostPortConfig:
enabled: true
hostPort: 8126
instrumentation:
enabled: false
logCollection:
enabled: true
containerCollectAll: true
eventCollection:
collectKubernetesEvents: true
override:
clusterAgent:
tolerations:
- key: karpenter.sh/nodepool
operator: Equal
value: <NODEPOOL-NAME>
nodeAgent:
env:
- name: DD_LOGS_CONFIG_AUTO_MULTI_LINE_DETECTION
value: "true"
- name: DD_PROFILING_ENABLED
value: "true"
- name: DD_TRACE_ENABLED
value: "true"
- name: DD_LOGS_ENABLED
value: "true"
- name: DD_LOGS_INJECTION
value: "true"
- name: DD_CONTAINER_EXCLUDE
value: "name:.*"
- name: DD_CONTAINER_INCLUDE
value: "name:<container-name>" # match spec.template.spec.containers.name
tolerations:
- key: karpenter.sh/nodepool
operator: Equal
value: <NODEPOOL-NAME>
Apply it:
kubectl apply -f datadogagent.yaml -n datadog
Step 4 — Verify the Deployment
kubectl get datadogagent -n datadog
kubectl get pods -n datadog
All pods should reach Running state within a few minutes.
This is a reference configuration that can be adjusted for your environment — expand DD_CONTAINER_INCLUDE to cover more workloads or modify any feature flags as needed.