DataDog / helm-charts

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

Disable mutations on Datadog resources pods #1330

Closed liliyadd closed 6 months ago

liliyadd commented 6 months ago

What this PR does / why we need it:

Exclude the agent, cluster agent and clusterchecks pods from any kind of mutation performed by the Admission Controller. With this change Admission Controllers will not inject configs, tags or tracing libraries into DD resources.

Agent pod for latest helm-chart:

apiVersion: v1
kind: Pod
metadata:
  annotations:
    checksum/autoconf-config: 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b
    checksum/checksd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
    checksum/clusteragent_token: 03184415b2e1becb4249a9453d54f35f031f89ed107c895018bf4ec611d9265e
    checksum/confd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
    checksum/install_info: 53a0b6d31a0130a55703ac799b2ab18fdaed9e338e6d27bf12695bb42b598cb4
  creationTimestamp: "2024-02-22T16:23:29Z"
  generateName: dd2-datadog-
  labels:
    app: dd2-datadog
    app.kubernetes.io/component: agent
    app.kubernetes.io/instance: dd2
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dd2-datadog
    controller-revision-hash: 76f596d679
    pod-template-generation: "1"
  name: dd2-datadog-56z92
  namespace: default
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: DaemonSet
    name: dd2-datadog
    uid: 62e74eb9-7170-4bb2-a7da-f1118d8fefac
  resourceVersion: "250590100"
  uid: bf578731-e008-4879-852c-60318d3a069d
...

Agent pod with PR's change:

apiVersion: v1
kind: Pod
metadata:
  annotations:
    checksum/autoconf-config: 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b
    checksum/checksd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
    checksum/clusteragent_token: f80d582aa8960692c0c36b44a445c3fab290bcedf3eff324ee7b2700d8181699
    checksum/confd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
    checksum/install_info: ba661cfd1e600203476c7247bad81157e5bc70aaa7f91e6cdd6be6a469cd0093
  creationTimestamp: "2024-02-22T18:38:41Z"
  generateName: dd2-datadog-
  labels:
    admission.datadoghq.com/enabled: "false"
    app: dd2-datadog
    app.kubernetes.io/component: agent
    app.kubernetes.io/instance: dd2
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dd2-datadog
    controller-revision-hash: bd85b9c86
    pod-template-generation: "1"
  name: dd2-datadog-6hvj6
  namespace: default
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: DaemonSet
    name: dd2-datadog
    uid: 011344d2-58f0-4da9-b9e5-71fcdfd6e691
  resourceVersion: "250664017"
  uid: 870f46c9-946c-4a5a-9a4a-0b868511801d

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Special notes for your reviewer:

Checklist

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

liliyadd commented 6 months ago

/merge

dd-devflow[bot] commented 6 months ago

:x: MergeQueue

You are not allowed to use the merge queue towards main.

If you need support, contact us on Slack #ci-interfaces with those details!

fanny-jiang commented 6 months ago

/merge

dd-devflow[bot] commented 6 months ago

:steam_locomotive: MergeQueue

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals. Note: if you pushed new commits since the last approval, you may need additional approval. You can remove it from the waiting list with /remove command.

Use /merge -c to cancel this operation!

dd-devflow[bot] commented 6 months ago

:steam_locomotive: MergeQueue

Added to the queue.

This build is going to start soon! (estimated merge in less than 0s)

Use /merge -c to cancel this operation!

dd-devflow[bot] commented 6 months ago

:x: MergeQueue

The merge has been interrupted. The current limit on the base branch 'main' is 120 minutes.

If you need support, contact us on Slack #ci-interfaces with those details!