Skip to content

Support volume/volumeMounts in DatadogAgentProfile#3194

Merged
tbavelier merged 2 commits into
mainfrom
tbavelier/add-volume-to-daps
Jul 8, 2026
Merged

Support volume/volumeMounts in DatadogAgentProfile#3194
tbavelier merged 2 commits into
mainfrom
tbavelier/add-volume-to-daps

Conversation

@tbavelier

@tbavelier tbavelier commented Jun 25, 2026

Copy link
Copy Markdown
Member

What does this PR do?

See title

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

  1. Deploy with DAP enabled on a 2-nodes+ cluster
  2. Create a DDA with extraConfd, e.g.:
      extraConfd:
        configDataMap:
          openmetrics.yaml: |-
            ad_identifiers:
              - coredns
            init_config:
              debug_metrics:
                metric_contexts: true
            instances:
              - openmetrics_endpoint: http://%%host%%:9153/metrics
                namespace: k8s.debug
                metrics:
                  - .*
  3. Create a configmap with a different config:
    apiVersion: v1
    data:
      openmetrics.yaml: |-
        ad_identifiers:
          - coredns
        instances:
          - openmetrics_endpoint: http://%%host%%:9153/metrics
            min_collection_interval: 60
            namespace: k8s.debug.custom
            metrics:
              - .*
    kind: ConfigMap
    metadata:
      name: custom-openmetrics-config
  4. Create a profile targetting at least one node with this configmap:
    apiVersion: datadoghq.com/v1alpha1
    kind: DatadogAgentProfile
    metadata:
      name: foo-bar
    spec:
      profileAffinity:
        profileNodeAffinity:
          - key: foo
            operator: In
            values:
              - bar
      config:
        override:
          nodeAgent:
            containers:
              agent:
                volumeMounts:
                  - name: custom-check
                    mountPath: /etc/datadog-agent/conf.d/openmetrics.yaml
                    subPath: openmetrics.yaml
            volumes:
              - name: custom-check
                configMap:
                  name: custom-openmetrics-config
                  items:
                    - key: openmetrics.yaml
                      path: openmetrics.yaml
  5. Verify the non DAP Agent pod has the config from extraConfd while the DAP pod has the one from the configmap:
╰─❯ k exec -it foo-bar-agent-pwnhc -c agent -- bash -c 'cat /etc/datadog-agent/conf.d/openmetrics.yaml'
ad_identifiers:
  - coredns
instances:
  - openmetrics_endpoint: http://%%host%%:9153/metrics
    min_collection_interval: 60
    namespace: k8s.debug.custom
    metrics:
      - .*                                                                                                                                                                                                                         ╭─ ~/misc/k8s_stuff/minikube/operator local !10 ?8                                                                                                                                                 󱃾 kind-local-k8s/system 11:53:23
╰─❯ k exec -it foo-bar-agent-pwnhc -c agent -- bash -c 'cat /etc/datadog-agent/conf.d/openmetrics.yaml'
╭─ ~/misc/k8s_stuff/minikube/operator local !10 ?8                                                                                                                                           ✘ INT 󱃾 kind-local-k8s/system 11:53:26
╰─❯ k exec -it datadog-agent-5hntp -c agent -- bash -c 'cat /etc/datadog-agent/conf.d/openmetrics.yaml'
ad_identifiers:
  - coredns
init_config:
  debug_metrics:
    metric_contexts: true
instances:
  - openmetrics_endpoint: http://%%host%%:9153/metrics
    namespace: k8s.debug
    metrics:
      - .*

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

@tbavelier tbavelier added this to the v1.29.0 milestone Jun 25, 2026
@tbavelier tbavelier added the enhancement New feature or request label Jun 25, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jun 25, 2026

Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 44.45% (+0.10%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: cbec20c | Docs | Datadog PR Page | Give us feedback!

@tbavelier
tbavelier marked this pull request as ready for review June 25, 2026 09:36
@tbavelier
tbavelier requested a review from a team June 25, 2026 09:36
@tbavelier
tbavelier requested a review from a team as a code owner June 25, 2026 09:36
@tbavelier
tbavelier merged commit 25f2b43 into main Jul 8, 2026
38 checks passed
@tbavelier
tbavelier deleted the tbavelier/add-volume-to-daps branch July 8, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants