4‐Datadog Setup on EKS - harishgorla5/HINTechnologies_datadog GitHub Wiki

🐶 Datadog Setup on Amazon EKS (Elastic Kubernetes Service)

This guide walks you through the step-by-step setup of Datadog monitoring on an Amazon EKS cluster using the Datadog Helm chart.


Fallow the below to setup EKS

EKS Setup

🧰 Prerequisites

Before you begin, make sure you have:

  • ✅ An EKS Cluster running (1+ master & worker nodes)
  • kubectl configured to access your EKS cluster
  • ✅ Helm v3+ installed
  • ✅ A Datadog API Key
  • ✅ Access to create namespaces and install charts in your cluster

📦 Step 1: Add the Datadog Helm Repository

helm repo add datadog https://helm.datadoghq.com
helm repo update

🗂️ Step 2: Create the Namespace (optional)

kubectl create namespace <datadog>

🔐 Step 3: Create a Kubernetes Secret for the API Key

kubectl create secret generic datadog-secret \
  --from-literal api-key=<YOUR_DATADOG_API_KEY> \
  --namespace default

Replace <YOUR_DATADOG_API_KEY> with your real Datadog API key.


⚙️ Step 4: Install the Datadog Agent via Helm

  • ✅ The Datadog Agent is a lightweight daemon that runs on each node in your cluster. Its main job is to collect and report metrics, logs, traces, and other telemetry data to Datadog.
  • ✅ Without the Datadog Agent, your EKS cluster and apps remain invisible to Datadog — no metrics, no logs, no APM, no monitoring.
  • Read More About Datadog Agent
helm install datadog-agent datadog/datadog -f https://raw.githubusercontent.com/harishgorla5/datadog/refs/heads/main/datadog-default.yaml --namespace default

✅ Step 5: Verify the Installation

  • Deploy Project 4 for Monitoring
kubectl apply -f https://raw.githubusercontent.com/harishgorla5/Project04/refs/heads/project4/project04.yaml  
kubectl get pods -n default

You should see pods like:

image


🔍 Step 6: Check Logs & Status

kubectl logs 

image

kubectl exec -it <datadog-agent-pod> -- agent status

image


📊 Step 7: View Metrics in Datadog

  1. Go to Datadog UI

  2. Navigate to:

    • Infrastructure → Containers
    • Kubernetes → Cluster Explorer
    • APM → Services
    • Logs → Live Tail
  3. Host Level image

  4. Container Level image


📊 Step 8: Alert Setup

  1. Go back to Monitors → New Monitor → Logs.
  2. Define the Search Query
service:project4 source:nginx status:404
  1. Set Alert Conditions
  • Alert type: Log alert
  • Trigger: When count is above 5 over the last 5 minutes (or your preference)
  • Evaluation window: 5 minutes
  1. Set Notification Message
🚨 [NGINX 404 Error] Alert: {{value}} 404 errors detected in project4!

Service: project4  
Source: nginx  
Host: {{host.name}}  
Timestamp: {{timestamp}}

@[email protected]
@[email protected]
@slack-yourchannel
  1. Save the Monitor
  • Give it a name like: NGINX 404 Error Monitor - project4
  • Set priority and tags (e.g., project4, nginx, log-alerts)
  1. Below are the references image

image


🧹 Uninstall Datadog from EKS

helm uninstall datadog-agent -n datadog
kubectl delete namespace datadog

📎 Resources

⚠️ **GitHub.com Fallback** ⚠️