datadog-operator icon indicating copy to clipboard operation
datadog-operator copied to clipboard

Configuration of Tag Extraction from Node Labels

Open arzarif opened this issue 3 years ago • 1 comments

Datadog supports the extraction of tags from various sources: pod labels, pod annotations, and node labels (see https://docs.datadoghq.com/agent/kubernetes/tag/?tab=containerizedagent).

Currently, it appears that the operator only supports the configuration of tag extraction via pod labels and pod annotations via agent.config.podLabelsAsTags and agent.config.podAnnotationsAsTags, respectively. Is there a reason why something like agent.config.nodeLabelsAsTags doesn't exist?

arzarif avatar Apr 16 '21 23:04 arzarif

I would also love to see agent.config.nodeLabelsAsTags specifically, but also all the options on the page @arzarif linked to.

Would adding support just be a matter of adding those additional values to datadogagent_types.go, datadogagent_default.go, utils.go and const.go (in addition to updating the relevant tests and docs)?

As a work around for now, I'm just adding the relevent env vars directly to the agent config, like:

spec:
  agent:
    config:
      env:
      - name: DD_KUBERNETES_NODE_LABELS_AS_TAGS
        value: '{"app": "kube_node_app"}'

jketcham avatar Apr 05 '22 03:04 jketcham