DataDog / helm-charts

Helm charts for Datadog products
Apache License 2.0
326 stars 1.01k forks source link

feat(admission controller): add .injectConfig.injectContainerName setting #1401

Closed wdhif closed 1 month ago

wdhif commented 1 month ago

Adds the .injectConfig.injectContainerName setting for the Admission Controller.

This setting enables injection of the container name along with the pod uid in DD_ENTITY_ID.

What this PR does / why we need it:

This is needed to support this feature: https://github.com/DataDog/datadog-agent/pull/23447

Special notes for your reviewer:

With this manifest:

registry: public.ecr.aws/datadog
datadog:
  clusterName: wassim-minikube
  apiKeyExistingSecret: datadog-secret
  appKeyExistingSecret: datadog-secret
  kubelet:
    tlsVerify: false
    coreCheck: true
clusterAgent:
  image:
    tag: 7.54.0-rc.3
  admissionController:
    injectConfig:
      injectContainerName: true

You will see:

➜  helm k exec -it datadog-agent-cluster-agent-547446b8f9-nwbcx -- agent config | grep inject_container_name
Defaulted container "cluster-agent" out of: cluster-agent, init-volume (init)
    inject_container_name: true

With this manifest:

registry: public.ecr.aws/datadog
datadog:
  clusterName: wassim-minikube
  apiKeyExistingSecret: datadog-secret
  appKeyExistingSecret: datadog-secret
  kubelet:
    tlsVerify: false
    coreCheck: true
clusterAgent:
  image:
    tag: 7.54.0-rc.3-jmx

You will see:

➜  helm k exec -it datadog-agent-cluster-agent-5bfffdbf47-28qgj -- agent config | grep inject_container_name
Defaulted container "cluster-agent" out of: cluster-agent, init-volume (init)
    inject_container_name: false

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

wdhif commented 1 month ago

We will support this behind the OriginDetectionUnified setting once support in the Agent and libraries is complete.