DataDog / datadog-agent

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

Generic way to write contents of conf.d from a kubernetes configmap #2458

Open zapman449 opened 6 years ago

zapman449 commented 6 years ago

We leverage dd-agent as a daemonset in kubernetes. This is a lovely way to run dd-agent, but it has a couple challenges:

  1. I can't update the /etc/dd-agent folder after launch with a postStart command, and have the process refresh it's config.
  2. autodiscovery is amazing, but some pods/containers I can't modify their annotations to leverage it (like etcd pods in a kops deploy)

What I'd love is to lay out in a configmap something like:

---
apiVersion: v1
data:
  "conf.d/etcd.yaml": |
    init_config:
    instances:
      - "http://localhost:4001"
      - "http://localhost:4002"
kind: ConfigMap

Then feed the dd-agent daemonset something like "KUBERNETES_CONFIGRUATION_CONFIGMAP: $NAMESPACE/$CM_NAME". dd-agent on startup would read the CM, write out the relevant files, then start dd-agent as normal.

hkaj commented 6 years ago

Hi @zapman449 Thanks for reaching out! It is possible to create a config map with check files, configuration files, or even datadog.yaml as explained here. Does that fit your use case?