DataDog / datadog-agent

Main repository for Datadog Agent
https://docs.datadoghq.com/
Apache License 2.0
2.89k stars 1.21k forks source link

Kubernetes DeamonSet - Config File "datadog" Not Found in "[/etc/datadog-agent]" #11693

Open taraktikos opened 2 years ago

taraktikos commented 2 years ago

Output of the info page (if this is a bug)

2022-04-17 14:10:46 UTC | CORE | INFO | (pkg/util/log/log.go:572 in func1) | runtime: final GOMAXPROCS value is: 4
2022-04-17 14:10:46 UTC | CORE | WARN | (pkg/util/log/log.go:592 in func1) | Error loading config: Config File "datadog" Not Found in "[/etc/datadog-agent]"
2022-04-17 14:10:46 UTC | CORE | INFO | (pkg/util/log/log.go:572 in func1) | Features detected from environment: kubernetes
2022-04-17 14:10:46 UTC | CORE | ERROR | (cmd/agent/app/run.go:241 in StartAgent) | Failed to setup config unable to load Datadog config file: Config File "datadog" Not Found in "[/etc/datadog-agent]"
2022-04-17 14:10:46 UTC | CORE | INFO | (pkg/logs/logs.go:176 in Stop) | Stopping logs-agent
2022-04-17 14:10:46 UTC | CORE | INFO | (pkg/logs/logs.go:188 in Stop) | logs-agent stopped
2022-04-17 14:10:46 UTC | CORE | INFO | (cmd/agent/app/run.go:501 in StopAgent) | See ya!
Error: unable to set up global agent configuration: unable to load Datadog config file: Config File "datadog" Not Found in "[/etc/datadog-agent]"

Describe what happened: I'm trying to install datadog agent to local kind cluster using this instruction https://docs.datadoghq.com/agent/kubernetes/installation/?tab=daemonset I use the following manifest template https://docs.datadoghq.com/resources/yaml/datadog-agent-logs.yaml

Describe what you expected: Deamon set is running and sending logs

Steps to reproduce the issue:

kind create cluster
kubectl apply -f "https://raw.githubusercontent.com/DataDog/datadog-agent/master/Dockerfiles/manifests/rbac/clusterrole.yaml"
kubectl apply -f "https://raw.githubusercontent.com/DataDog/datadog-agent/master/Dockerfiles/manifests/rbac/serviceaccount.yaml"
kubectl apply -f "https://raw.githubusercontent.com/DataDog/datadog-agent/master/Dockerfiles/manifests/rbac/clusterrolebinding.yaml"

Change API key and apply 
https://docs.datadoghq.com/resources/yaml/datadog-agent-logs.yaml 

Additional environment details (Operating System, Cloud provider, etc): MacOS, KIND (https://kind.sigs.k8s.io/)

carlosroman commented 2 years ago

Which version of kind are you using? I was able to get this working with version 0.12.0, on MacOS. After downloading datadog-agent-logs.yaml, when you added the API key did you base64 encoding it? If you run echo -n '<Your API key>' | base64, make sure to replace PUT_YOUR_BASE64_ENCODED_API_KEY_HERE in datadog-agent-logs.yaml with the encoded API key. After that, running kubectl apply -f datadog-agent-logs.yaml should deploy everything correctly.