datadog-operator
datadog-operator copied to clipboard
Configuration of Tag Extraction from Node Labels
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?
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"}'