Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ ebpf/builds/

# DS_Store
.DS_Store

.envrc
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -509,23 +509,24 @@ endif
install-go:
BUILDGOVERSION=$(BUILDGOVERSION) ./scripts/install-go

EXISTING_NAMESPACE = $(shell $(KUBECTL) get ns datadog-agent -oname || echo "")
EXISTING_HELM_RELEASE = $(shell helm status -n datadog-agent my-datadog-operator --output json 2>/dev/null | grep -q '"status":"deployed"' && echo "true" || echo "")

lima-install-datadog-agent:
ifeq (true,$(INSTALL_DATADOG_AGENT))
ifeq (,$(EXISTING_NAMESPACE))
$(KUBECTL) create ns datadog-agent
ifeq (,$(EXISTING_HELM_RELEASE))
$(KUBECTL) create ns datadog-agent 2>/dev/null || true
helm repo add --force-update datadoghq https://helm.datadoghq.com
helm install -n datadog-agent my-datadog-operator datadoghq/datadog-operator
$(KUBECTL) create secret -n datadog-agent generic datadog-secret --from-literal api-key=${STAGING_DATADOG_API_KEY} --from-literal app-key=${STAGING_DATADOG_APP_KEY}
$(KUBECTL) create secret -n datadog-agent generic datadog-secret --from-literal api-key=${STAGING_DATADOG_API_KEY} --from-literal app-key=${STAGING_DATADOG_APP_KEY} 2>/dev/null || true
$(KUBECTL) wait --for=condition=Available -n datadog-agent deployment --all --timeout=120s
endif
$(KUBECTL) apply -f - < examples/datadog-agent.yaml
LIMA_INSTANCE=$(LIMA_INSTANCE) envsubst < examples/datadog-agent.yaml | $(KUBECTL) apply -f -
endif

open-dd:
ifeq (true,$(INSTALL_DATADOG_AGENT))
ifdef STAGING_DD_SITE
open "${STAGING_DD_SITE}/infrastructure?host=lima-$(LIMA_INSTANCE)&tab=details"
open "https://${STAGING_DD_SITE}/infrastructure/hosts?hostType=all-hosts&scope=host%3Alima-$(LIMA_INSTANCE)"
else
@echo "You need to define STAGING_DD_SITE in your .zshrc or similar to use this feature"
endif
Expand Down
7 changes: 6 additions & 1 deletion examples/datadog-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
namespace: datadog-agent
spec:
global:
clusterName: operator-lima-cluster
clusterName: ${LIMA_INSTANCE}
logLevel: debug
site: datadoghq.com
credentials:
Expand Down Expand Up @@ -50,3 +50,8 @@ spec:
nodeAgent:
image:
name: gcr.io/datadoghq/agent:latest
env:
- name: DD_HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName