Skip to content

Commit 6db36e9

Browse files
authored
Add providers.gke.gdc option to datadog chart (#1521)
* wip * add providers.gke.gdc option to datadog chart * update test baselines * syntax fix * add back logs hostPaths * cleanup/wip * fixes, add test, update baselines * fix dd_nodename * fix test, bump version, update baselines * update readme, fix test * cleanup/refactor * apply review suggestions * bump chart version and update baselines/docs * remove redundant template
1 parent db5854c commit 6db36e9

27 files changed

+920
-126
lines changed

charts/datadog/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Datadog changelog
22

3+
## 3.79.0
4+
5+
* Add Logs Collection support for Google GKE on GDC
6+
37
## 3.78.0
48

59
* Set default `Agent` and `Cluster-Agent` version to `7.59.0`.

charts/datadog/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v1
22
name: datadog
3-
version: 3.78.0
3+
version: 3.79.0
44
appVersion: "7"
55
description: Datadog Agent
66
keywords:

charts/datadog/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Datadog
22

3-
![Version: 3.78.0](https://img.shields.io/badge/Version-3.78.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
3+
![Version: 3.79.0](https://img.shields.io/badge/Version-3.79.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
44

55
[Datadog](https://www.datadoghq.com/) is a hosted infrastructure monitoring platform. This chart adds the Datadog Agent to all nodes in your cluster via a DaemonSet. It also optionally depends on the [kube-state-metrics chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics). For more information about monitoring Kubernetes with Datadog, please refer to the [Datadog documentation website](https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/).
66

@@ -879,6 +879,7 @@ helm install <RELEASE_NAME> \
879879
| providers.eks.ec2.useHostnameFromFile | bool | `false` | Use hostname from EC2 filesystem instead of fetching from metadata endpoint. |
880880
| providers.gke.autopilot | bool | `false` | Enables Datadog Agent deployment on GKE Autopilot |
881881
| providers.gke.cos | bool | `false` | Enables Datadog Agent deployment on GKE with Container-Optimized OS (COS) |
882+
| providers.gke.gdc | bool | `false` | Enables Datadog Agent deployment on GKE on Google Distributed Cloud (GDC) |
882883
| registry | string | `nil` | Registry to use for all Agent images (default to [gcr.io | eu.gcr.io | asia.gcr.io | datadoghq.azurecr.io | public.ecr.aws/datadog] depending on datadog.site value) |
883884
| remoteConfiguration.enabled | bool | `true` | Set to true to enable remote configuration on the Cluster Agent (if set) and the node agent. Can be overridden if `datadog.remoteConfiguration.enabled` Preferred way to enable Remote Configuration. |
884885
| targetSystem | string | `"linux"` | Target OS for this deployment (possible values: linux, windows) |

charts/datadog/ci/gke-gdc-values.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
providers:
2+
gke:
3+
gdc: true
4+
5+
datadog:
6+
apiKey: "00000000000000000000000000000000"
7+
appKey: "0000000000000000000000000000000000000000"
8+
9+
apm:
10+
socketEnabled: false
11+
portEnabled: false
12+
13+
logs:
14+
enabled: true
15+
containerCollectAll: true
16+
containerCollectUsingFiles: true
17+
autoMultiLineDetection: true
18+
19+
kubeStateMetricsCore:
20+
enabled: true

charts/datadog/templates/_components-common-env.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,10 @@
6464
- name: DD_EXCLUDE_PAUSE_CONTAINER
6565
value: "false"
6666
{{- end }}
67+
{{- if .Values.providers.gke.gdc }}
68+
- name: DD_KUBELET_CLIENT_CRT
69+
value: /certs/tls.crt
70+
- name: DD_KUBELET_CLIENT_KEY
71+
value: /certs/tls.key
72+
{{- end }}
6773
{{- end }}

charts/datadog/templates/_container-agent.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
- name: DD_HEALTH_PORT
122122
{{- $healthPort := .Values.agents.containers.agent.healthPort }}
123123
value: {{ $healthPort | quote }}
124-
{{- if eq .Values.targetSystem "linux" }}
124+
{{- if and (eq .Values.targetSystem "linux") (not .Values.providers.gke.gdc) }}
125125
- name: DD_DOGSTATSD_SOCKET
126126
value: {{ .Values.datadog.dogstatsd.socketPath | quote }}
127127
{{- end }}
@@ -237,6 +237,7 @@
237237
readOnly: true
238238
{{- end }}
239239
{{- if eq .Values.targetSystem "linux" }}
240+
{{- if not .Values.providers.gke.gdc }}
240241
- name: dsdsocket
241242
mountPath: {{ (dir .Values.datadog.dogstatsd.socketPath) }}
242243
readOnly: false
@@ -262,6 +263,7 @@
262263
mountPath: /etc/passwd
263264
readOnly: true
264265
{{- end }}
266+
{{- end }}
265267
{{- if or .Values.datadog.logs.enabled .Values.datadog.logsEnabled }}
266268
- name: pointerdir
267269
mountPath: /opt/datadog-agent/run
@@ -275,7 +277,7 @@
275277
mountPath: /var/log/containers
276278
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
277279
readOnly: true
278-
{{- if not .Values.datadog.criSocketPath }}
280+
{{- if and (not .Values.datadog.criSocketPath) (not .Values.providers.gke.gdc) }}
279281
- name: logdockercontainerpath
280282
mountPath: /var/lib/docker/containers
281283
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
@@ -338,6 +340,10 @@
338340
{{- if .Values.datadog.kubelet.hostCAPath }}
339341
{{ include "datadog.kubelet.volumeMount" . | indent 4 }}
340342
{{- end }}
343+
{{- if .Values.providers.gke.gdc }}
344+
- name: kubelet-cert-volume
345+
mountPath: /certs
346+
{{- end }}
341347
{{- if .Values.agents.volumeMounts }}
342348
{{ toYaml .Values.agents.volumeMounts | indent 4 }}
343349
{{- end }}

charts/datadog/templates/_container-cri-volumemounts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- define "container-crisocket-volumemounts" -}}
2-
{{- if .Values.datadog.containerRuntimeSupport.enabled }}
2+
{{- if (eq (include "container-runtime-support-enabled" .) "true") }}
33
{{- if eq .Values.targetSystem "linux" }}
44
- name: runtimesocketdir
55
mountPath: {{ print "/host/" (dir (include "datadog.dockerOrCriSocketPath" .)) | clean }}

charts/datadog/templates/_container-host-release-volumemounts.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{- define "linux-container-host-release-volumemounts" -}}
2+
{{- if not .Values.providers.gke.gdc }}
23
{{- if eq (include "should-enable-system-probe" .) "true" }}
34
- name: os-release-file
45
mountPath: /host{{ .Values.datadog.systemProbe.osReleasePath | default .Values.datadog.osReleasePath }}
@@ -9,3 +10,4 @@
910
readOnly: true
1011
{{- end }}
1112
{{- end }}
13+
{{- end }}

charts/datadog/templates/_container-trace-agent.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
readOnly: true
8787
{{- end }}
8888
{{- if eq .Values.targetSystem "linux" }}
89-
{{- if not .Values.providers.gke.autopilot }}
89+
{{- if not (or .Values.providers.gke.autopilot .Values.providers.gke.gdc) }}
9090
- name: procdir
9191
mountPath: /host/proc
9292
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
@@ -99,6 +99,7 @@
9999
- name: tmpdir
100100
mountPath: /tmp
101101
readOnly: false # Need RW for tmp directory
102+
{{- if not .Values.providers.gke.gdc }}
102103
- name: dsdsocket
103104
mountPath: {{ (dir .Values.datadog.dogstatsd.socketPath) }}
104105
readOnly: false # Need RW for UDS DSD socket
@@ -109,6 +110,7 @@
109110
{{- end }}
110111
{{- end }}
111112
{{- include "container-crisocket-volumemounts" . | nindent 4 }}
113+
{{- end }}
112114
{{- include "container-cloudinit-volumemounts" . | nindent 4 }}
113115
{{- if .Values.datadog.kubelet.hostCAPath }}
114116
{{ include "datadog.kubelet.volumeMount" . | indent 4 }}

charts/datadog/templates/_containers-common-env.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
- name: DD_KUBERNETES_HTTPS_KUBELET_PORT
3131
value: "0"
3232
{{- end }}
33+
{{- if .Values.providers.gke.gdc }}
34+
- name: DD_NODE_NAME
35+
valueFrom:
36+
fieldRef:
37+
apiVersion: v1
38+
fieldPath: spec.nodeName
39+
- name: DD_HOSTNAME
40+
value: "$(DD_NODE_NAME)-$(DD_CLUSTER_NAME)"
41+
{{- end }}
3342
{{- if eq .Values.targetSystem "linux" }}
3443
{{- if .Values.providers.eks.ec2.useHostnameFromFile }}
3544
- name: DD_HOSTNAME_FILE
@@ -116,7 +125,7 @@
116125
{{- end }}
117126
{{- end }}
118127
{{- else }} # No support for env AD
119-
{{- if .Values.datadog.containerRuntimeSupport.enabled }}
128+
{{- if (eq (include "container-runtime-support-enabled" .) "true") }}
120129
{{- if or .Values.providers.gke.autopilot .Values.datadog.criSocketPath }}
121130
- name: DD_CRI_SOCKET_PATH
122131
value: {{ print "/host/" (include "datadog.dockerOrCriSocketPath" .) | clean }}

0 commit comments

Comments
 (0)