Skip to content

Commit

Permalink
support setting annotations on datadog-operator deployment (#1449)
Browse files Browse the repository at this point in the history
* support setting annotations on datadog-operator deployment

This can be useful when interested in utilizing automatic
restarter/rescheduler tools like stakater/reloader to perform a fresh
rollout when a secret value (e.g. app key or api key) changes.
  • Loading branch information
0robustus1 authored Jul 19, 2024
1 parent 38a500e commit b46720a
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 93 deletions.
4 changes: 4 additions & 0 deletions charts/datadog-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.8.4

* Add option to specify `deployment.annotations`.

## 1.8.3

* Add `image.doNotCheckTag` option to permit skipping operator image tag compatibility.
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: datadog-operator
version: 1.8.3
version: 1.8.4
appVersion: 1.7.0
description: Datadog Operator
keywords:
Expand Down
3 changes: 2 additions & 1 deletion charts/datadog-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog Operator

![Version: 1.8.3](https://img.shields.io/badge/Version-1.8.3-informational?style=flat-square) ![AppVersion: 1.7.0](https://img.shields.io/badge/AppVersion-1.7.0-informational?style=flat-square)
![Version: 1.8.4](https://img.shields.io/badge/Version-1.8.4-informational?style=flat-square) ![AppVersion: 1.7.0](https://img.shields.io/badge/AppVersion-1.7.0-informational?style=flat-square)

## Values

Expand Down Expand Up @@ -28,6 +28,7 @@
| datadogMonitor.enabled | bool | `false` | Enables the Datadog Monitor controller |
| datadogSLO.enabled | bool | `false` | Enables the Datadog SLO controller |
| dd_url | string | `nil` | The host of the Datadog intake server to send Agent data to, only set this option if you need the Agent to send data to a custom URL |
| deployment.annotations | object | `{}` | Allows setting additional annotations for the deployment resource |
| env | list | `[]` | Define any environment variables to be passed to the operator. |
| fullnameOverride | string | `""` | |
| image.doNotCheckTag | bool | `false` | Permit skipping operator image tag compatibility with the chart. |
Expand Down
4 changes: 4 additions & 0 deletions charts/datadog-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Deployment
metadata:
name: {{ include "datadog-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.deployment.annotations }}
annotations:
{{ toYaml .Values.deployment.annotations | indent 4 }}
{{- end }}
labels:
{{ include "datadog-operator.labels" . | indent 4 }}
spec:
Expand Down
3 changes: 3 additions & 0 deletions charts/datadog-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ remoteConfiguration:
# remoteConfiguration.enabled -- If true, enables Remote Configuration in the Datadog Operator (beta). Requires clusterName, API and App keys to be set.
enabled: false

deployment:
# deployment.annotations -- Allows setting additional annotations for the deployment resource
annotations: {}
rbac:
# rbac.create -- Specifies whether the RBAC resources should be created
create: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: datadog-agent
labels:
app.kubernetes.io/name: datadog-operator
helm.sh/chart: datadog-operator-1.8.3
helm.sh/chart: datadog-operator-1.8.4
app.kubernetes.io/instance: datadog-operator
app.kubernetes.io/version: "1.7.0"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
namespace: datadog-agent
labels:
app.kubernetes.io/name: datadog-operator
helm.sh/chart: datadog-operator-1.8.3
helm.sh/chart: datadog-operator-1.8.4
app.kubernetes.io/instance: datadog-operator
app.kubernetes.io/version: "1.7.0"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog-clusterchecks
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.67.3'
helm.sh/chart: 'datadog-3.68.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -36,16 +36,16 @@ spec:

name: datadog-clusterchecks
annotations:
checksum/clusteragent_token: 940bb7a00150569c15840feeeaa4ec5f054ab8a9c543fd9c717853ef86408928
checksum/install_info: f50ea8a79f0564dc664ff870e2b565a24e874dd107024252b8439ef2771dc70c
checksum/clusteragent_token: b6f86c2f5bedfdb5004c60faa7201e578be2b0be3818cd517e958f3b76a07ae3
checksum/install_info: 9a6b3a0afdc7e755915a24989677c6d492582d562fdd38a2270518ae18310357
spec:
serviceAccountName: datadog-cluster-checks
automountServiceAccountToken: true
imagePullSecrets:
[]
initContainers:
- name: init-volume
image: "gcr.io/datadoghq/agent:7.54.0"
image: "gcr.io/datadoghq/agent:7.55.1"
imagePullPolicy: IfNotPresent
command: ["bash", "-c"]
args:
Expand All @@ -57,7 +57,7 @@ spec:
resources:
{}
- name: init-config
image: "gcr.io/datadoghq/agent:7.54.0"
image: "gcr.io/datadoghq/agent:7.55.1"
imagePullPolicy: IfNotPresent
command: ["bash", "-c"]
args:
Expand All @@ -70,7 +70,7 @@ spec:
{}
containers:
- name: agent
image: "gcr.io/datadoghq/agent:7.54.0"
image: "gcr.io/datadoghq/agent:7.55.1"
command: ["bash", "-c"]
args:
- rm -rf /etc/datadog-agent/conf.d && touch /etc/datadog-agent/datadog.yaml && exec agent run
Expand Down
14 changes: 7 additions & 7 deletions test/datadog/baseline/cluster-agent-deployment_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog-cluster-agent
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.67.3'
helm.sh/chart: 'datadog-3.68.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -36,17 +36,17 @@ spec:

name: datadog-cluster-agent
annotations:
checksum/clusteragent_token: 41016e2dccdc8ec14bc77b12fa837798cf9b49d6ec33b982f38a9357bfcdb015
checksum/clusteragent-configmap: fc0dc6008f97f0f0bbf7ff0d570e8f2aa1fe695c1d6e2ca0d4d014040fbdb06e
checksum/api_key: d625c7eeff65b2ba930348cd0cccd7158d616f7e71f4befd49eb3734387f2388
checksum/clusteragent_token: 459abf22e9c0b7c33f45f92b6e33f2f95b1d7a196953d49defa4dbf5559716db
checksum/clusteragent-configmap: 1870b1d37dffa2a9ff20295dd22d1ce1a0c508d09e47e7143bea43fbf3e6939e
checksum/api_key: 28e63a1c4b64c11f42208b7a22e1a9cac1e2c837cea1ca56788b8b748b370e5c
checksum/application_key: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
checksum/install_info: f50ea8a79f0564dc664ff870e2b565a24e874dd107024252b8439ef2771dc70c
checksum/install_info: 9a6b3a0afdc7e755915a24989677c6d492582d562fdd38a2270518ae18310357
spec:
serviceAccountName: datadog-cluster-agent
automountServiceAccountToken: true
initContainers:
- name: init-volume
image: "gcr.io/datadoghq/cluster-agent:7.54.0"
image: "gcr.io/datadoghq/cluster-agent:7.55.1"
imagePullPolicy: IfNotPresent
command:
- cp
Expand All @@ -59,7 +59,7 @@ spec:
mountPath: /opt/datadog-agent
containers:
- name: cluster-agent
image: "gcr.io/datadoghq/cluster-agent:7.54.0"
image: "gcr.io/datadoghq/cluster-agent:7.55.1"
imagePullPolicy: IfNotPresent
resources:
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog-cluster-agent
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.67.3'
helm.sh/chart: 'datadog-3.68.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -36,17 +36,17 @@ spec:

name: datadog-cluster-agent
annotations:
checksum/clusteragent_token: e49cae63816f935069ef6f12fb6355438b1303e5e141b5a7141baacf2d5d819b
checksum/clusteragent-configmap: fc0dc6008f97f0f0bbf7ff0d570e8f2aa1fe695c1d6e2ca0d4d014040fbdb06e
checksum/api_key: d625c7eeff65b2ba930348cd0cccd7158d616f7e71f4befd49eb3734387f2388
checksum/clusteragent_token: b30c3fd9a0ddb5efc2ce81df6b5668148dda9e587e2877e60ab5a98176fe1fa5
checksum/clusteragent-configmap: 1870b1d37dffa2a9ff20295dd22d1ce1a0c508d09e47e7143bea43fbf3e6939e
checksum/api_key: 28e63a1c4b64c11f42208b7a22e1a9cac1e2c837cea1ca56788b8b748b370e5c
checksum/application_key: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
checksum/install_info: f50ea8a79f0564dc664ff870e2b565a24e874dd107024252b8439ef2771dc70c
checksum/install_info: 9a6b3a0afdc7e755915a24989677c6d492582d562fdd38a2270518ae18310357
spec:
serviceAccountName: datadog-cluster-agent
automountServiceAccountToken: true
initContainers:
- name: init-volume
image: "gcr.io/datadoghq/cluster-agent:7.54.0"
image: "gcr.io/datadoghq/cluster-agent:7.55.1"
imagePullPolicy: IfNotPresent
command:
- cp
Expand All @@ -59,7 +59,7 @@ spec:
mountPath: /opt/datadog-agent
containers:
- name: cluster-agent
image: "gcr.io/datadoghq/cluster-agent:7.54.0"
image: "gcr.io/datadoghq/cluster-agent:7.55.1"
imagePullPolicy: IfNotPresent
resources:
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog-cluster-agent
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.67.3'
helm.sh/chart: 'datadog-3.68.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -36,17 +36,17 @@ spec:

name: datadog-cluster-agent
annotations:
checksum/clusteragent_token: 7a0ca4e15723140df2c3fc4bf3aac52589061ce45538b1db674ddcc72273e0b4
checksum/clusteragent-configmap: fc0dc6008f97f0f0bbf7ff0d570e8f2aa1fe695c1d6e2ca0d4d014040fbdb06e
checksum/api_key: d625c7eeff65b2ba930348cd0cccd7158d616f7e71f4befd49eb3734387f2388
checksum/clusteragent_token: 9970ddeb0c78cac061f61440e3235abd3701e14f4e3e4adbd5bd8ccf7b171042
checksum/clusteragent-configmap: 1870b1d37dffa2a9ff20295dd22d1ce1a0c508d09e47e7143bea43fbf3e6939e
checksum/api_key: 28e63a1c4b64c11f42208b7a22e1a9cac1e2c837cea1ca56788b8b748b370e5c
checksum/application_key: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
checksum/install_info: f50ea8a79f0564dc664ff870e2b565a24e874dd107024252b8439ef2771dc70c
checksum/install_info: 9a6b3a0afdc7e755915a24989677c6d492582d562fdd38a2270518ae18310357
spec:
serviceAccountName: datadog-cluster-agent
automountServiceAccountToken: true
initContainers:
- name: init-volume
image: "gcr.io/datadoghq/cluster-agent:7.54.0"
image: "gcr.io/datadoghq/cluster-agent:7.55.1"
imagePullPolicy: IfNotPresent
command:
- cp
Expand All @@ -59,7 +59,7 @@ spec:
mountPath: /opt/datadog-agent
containers:
- name: cluster-agent
image: "gcr.io/datadoghq/cluster-agent:7.54.0"
image: "gcr.io/datadoghq/cluster-agent:7.55.1"
imagePullPolicy: IfNotPresent
resources:
{}
Expand Down Expand Up @@ -119,7 +119,7 @@ spec:
- name: DD_ADMISSION_CONTROLLER_AGENT_SIDECAR_IMAGE_NAME
value: agent
- name: DD_ADMISSION_CONTROLLER_AGENT_SIDECAR_IMAGE_TAG
value: 7.54.0
value: 7.55.1
- name: DD_REMOTE_CONFIGURATION_ENABLED
value: "false"
- name: DD_CLUSTER_CHECKS_ENABLED
Expand Down
24 changes: 16 additions & 8 deletions test/datadog/baseline/daemonset_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.67.3'
helm.sh/chart: 'datadog-3.68.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand All @@ -30,8 +30,8 @@ spec:

name: datadog
annotations:
checksum/clusteragent_token: 287b49c857ea99e60a036ce189b6d1b59cb4a00baae0607a6b1b463ba2ea6613
checksum/install_info: f50ea8a79f0564dc664ff870e2b565a24e874dd107024252b8439ef2771dc70c
checksum/clusteragent_token: 179d0baafb25372e797d4253ad5e40a628e62ad44086dcb4401a466741784615
checksum/install_info: 9a6b3a0afdc7e755915a24989677c6d492582d562fdd38a2270518ae18310357
checksum/autoconf-config: 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b
checksum/confd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
checksum/checksd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
Expand All @@ -42,7 +42,7 @@ spec:
hostPID: true
containers:
- name: agent
image: "gcr.io/datadoghq/agent:7.54.0"
image: "gcr.io/datadoghq/agent:7.55.1"
imagePullPolicy: IfNotPresent
command: ["agent", "run"]

Expand Down Expand Up @@ -76,6 +76,11 @@ spec:
value: "false"



- name: DD_PROCESS_AGENT_DISCOVERY_ENABLED
value: "true"
- name: DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED
value: "false"
- name: DD_LOG_LEVEL
value: "INFO"
- name: DD_DOGSTATSD_PORT
Expand Down Expand Up @@ -192,7 +197,7 @@ spec:
successThreshold: 1
timeoutSeconds: 5
- name: trace-agent
image: "gcr.io/datadoghq/agent:7.54.0"
image: "gcr.io/datadoghq/agent:7.55.1"
imagePullPolicy: IfNotPresent
command: ["trace-agent", "-config=/etc/datadog-agent/datadog.yaml"]
resources:
Expand Down Expand Up @@ -298,7 +303,7 @@ spec:
port: 8126
timeoutSeconds: 5
- name: process-agent
image: "gcr.io/datadoghq/agent:7.54.0"
image: "gcr.io/datadoghq/agent:7.55.1"
imagePullPolicy: IfNotPresent
command: ["process-agent", "--cfgpath=/etc/datadog-agent/datadog.yaml"]
resources:
Expand Down Expand Up @@ -336,8 +341,11 @@ spec:
name: datadog-cluster-agent
key: token


- name: DD_PROCESS_AGENT_DISCOVERY_ENABLED
value: "true"
- name: DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED
value: "false"
- name: DD_LOG_LEVEL
value: "INFO"
- name: DD_SYSTEM_PROBE_ENABLED
Expand Down Expand Up @@ -387,7 +395,7 @@ spec:

- name: init-volume

image: "gcr.io/datadoghq/agent:7.54.0"
image: "gcr.io/datadoghq/agent:7.55.1"
imagePullPolicy: IfNotPresent
command: ["bash", "-c"]
args:
Expand All @@ -400,7 +408,7 @@ spec:
{}
- name: init-config

image: "gcr.io/datadoghq/agent:7.54.0"
image: "gcr.io/datadoghq/agent:7.55.1"
imagePullPolicy: IfNotPresent
command:
- bash
Expand Down
Loading

0 comments on commit b46720a

Please sign in to comment.