Build and deploy the Datadog Operator from local source into a kind (Kubernetes in Docker) cluster for testing. Use this skill whenever the user wants to test operator changes locally, deploy the operator to a local cluster, verify operator behavior on Kubernetes, or iterate on operator code with a real cluster. Invoke this whenever someone mentions testing the operator locally, deploying to kind, or any task involving a local Kubernetes environment + Datadog Operator — even if they don't explicitly say 'kind' or 'operator-kind-test'.
You are helping deploy and test the Datadog Operator from local source on a kind cluster. This gives you a real Kubernetes environment to verify operator changes against the Datadog backend.
The whole flow runs locally: create a kind cluster, build the operator image, load it into kind, deploy, and apply a DatadogAgent CR so the agent connects to Datadog.
A previous test cluster may still be running. Delete it first so you start clean — this is idempotent and safe even if no cluster exists:
# Delete any existing DatadogAgent CR first (avoids finalizer hang)
kubectl --context kind-datadog-operator-test -n system delete datadogagent datadog --ignore-not-found 2>/dev/null || true
# Delete the kind cluster
kind delete cluster --name datadog-operator-test 2>/dev/null || true
Extract from the user's request:
app.datadoghq.comdd.datad0g.comcmd/main.go and api/datadoghq/).kind create cluster --name datadog-operator-test
This creates a single-node cluster and sets kubectl context to kind-datadog-operator-test.
The Datadog internal Go proxy (depot-read-api-go.us1.ddbuild.io) is often unreachable from local machines. Override GOPROXY to use the public proxy:
GOPROXY=https://proxy.golang.org,direct make docker-build IMG=datadog-operator:local
This builds the operator binary inside Docker using the repo's Dockerfile and tags it as datadog-operator:local.
Kind clusters can't pull from the local Docker daemon directly. Load the image explicitly:
kind load docker-image datadog-operator:local --name datadog-operator-test
GOPROXY=https://proxy.golang.org,direct make install
GOPROXY=https://proxy.golang.org,direct make deploy IMG=datadog-operator:local
This installs all CRDs (DatadogAgent, DatadogMonitor, etc.) and deploys the operator into the system namespace.
After deploying, verify the operator pod is running:
kubectl -n system get pods
Wait until the operator pod shows Running and 1/1 ready.
Run the following to get a Datadog API key:
# Production
dd-auth -s app.datadoghq.com -o
# Staging
dd-auth -s dd.datad0g.com -o
Capture the API key from the output.
kubectl -n system create secret generic datadog-secret \
--from-literal api-key=<API_KEY>
Replace <API_KEY> with the key obtained in the previous step.
Apply this manifest to get the agent running with minimal config.
For staging, set spec.global.site to datad0g.com so the agent reports to the staging backend. For production, either omit the site field (defaults to datadoghq.com) or set it explicitly.
apiVersion: datadoghq.com/v2alpha1