Skip to content

Commit

Permalink
add providers.gke.gdc option to datadog chart
Browse files Browse the repository at this point in the history
  • Loading branch information
fanny-jiang committed Sep 11, 2024
1 parent 869bec7 commit 8cf2f58
Show file tree
Hide file tree
Showing 18 changed files with 264 additions and 3,955 deletions.
2 changes: 1 addition & 1 deletion charts/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 3.70.7
version: 3.71.0
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
3 changes: 2 additions & 1 deletion charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.70.7](https://img.shields.io/badge/Version-3.70.7-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.71.0](https://img.shields.io/badge/Version-3.71.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)

[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/).

Expand Down Expand Up @@ -871,6 +871,7 @@ helm install <RELEASE_NAME> \
| providers.eks.ec2.useHostnameFromFile | bool | `false` | Use hostname from EC2 filesystem instead of fetching from metadata endpoint. |
| providers.gke.autopilot | bool | `false` | Enables Datadog Agent deployment on GKE Autopilot |
| providers.gke.cos | bool | `false` | Enables Datadog Agent deployment on GKE with Container-Optimized OS (COS) |
| providers.gke.gdc | bool | `false` | Enables Datadog Agent deployment on GKE on Google Distributed Cloud (GDC) |
| registry | string | `nil` | Registry to use for all Agent images (default to [gcr.io | eu.gcr.io | asia.gcr.io | public.ecr.aws/datadog] depending on datadog.site value) |
| 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. |
| targetSystem | string | `"linux"` | Target OS for this deployment (possible values: linux, windows) |
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ On GKE Autopilot, only one "datadog" Helm chart release is allowed by Kubernetes

{{- end }}

{{- if and (not .Values.providers.gke.autopilot) (not .Values.datadog.clusterName)}}
{{- if and (not .Values.providers.gke.gdc) (not .Values.datadog.clusterName)}}

###########################################################################
#### WARNING: Cluster name must be set on Google Distributed Cloud ####
Expand Down
11 changes: 5 additions & 6 deletions charts/datadog/templates/_container-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@
{{- end }}
env:
{{- include "containers-common-env" . | nindent 4 }}
{{- include "fips-envvar" . | nindent 4 }}
{{- include "processes-common-envs" . | nindent 4 }}

{{- include "fips-envvar" . | indent 4 }}
{{- include "processes-common-envs" . | indent 4 }}
{{- if .Values.datadog.logLevel }}
- name: DD_LOG_LEVEL
value: {{ .Values.agents.containers.agent.logLevel | default .Values.datadog.logLevel | quote }}
Expand Down Expand Up @@ -121,7 +120,7 @@
- name: DD_HEALTH_PORT
{{- $healthPort := .Values.agents.containers.agent.healthPort }}
value: {{ $healthPort | quote }}
{{- if eq .Values.targetSystem "linux" }}
{{- if and (eq .Values.targetSystem "linux") (not .Values.providers.gke.gdc) }}
- name: DD_DOGSTATSD_SOCKET
value: {{ .Values.datadog.dogstatsd.socketPath | quote }}
{{- end }}
Expand Down Expand Up @@ -208,7 +207,7 @@
subPath: install_info
mountPath: /etc/datadog-agent/install_info
readOnly: true
{{- include "linux-container-host-release-volumemounts" . | nindent 4 }}
{{- include "linux-container-host-release-volumemounts" . | indent 4 }}
{{- if eq (include "should-mount-fips-configmap" .) "true" }}
{{- include "linux-container-fips-proxy-cfg-volumemount" . | nindent 4 }}
{{- end }}
Expand All @@ -220,7 +219,7 @@
- name: auth-token
mountPath: {{ template "datadog.confPath" . }}/auth
readOnly: false # Need RW to write auth token
{{- end }}
{{- end -}}
{{- if not .Values.providers.gke.gdc }}
- name: tmpdir
mountPath: /tmp
Expand Down
6 changes: 6 additions & 0 deletions charts/datadog/templates/_containers-common-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
- name: DD_KUBERNETES_HTTPS_KUBELET_PORT
value: "0"
{{- end }}
{{- if .Values.providers.gke.gdc }}
- name: DD_HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{- end }}
{{- if eq .Values.targetSystem "linux" }}
{{- if .Values.providers.eks.ec2.useHostnameFromFile }}
- name: DD_HOSTNAME_FILE
Expand Down
4 changes: 2 additions & 2 deletions charts/datadog/templates/_containers-init-linux.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- define "containers-init-linux" -}}
- name: init-volume
{{- if not .Values.providers.gke.autopilot }}
{{ include "generate-security-context" (dict "securityContext" .Values.agents.containers.initContainers.securityContext "targetSystem" .Values.targetSystem "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version) | indent 2 }}
{{- include "generate-security-context" (dict "securityContext" .Values.agents.containers.initContainers.securityContext "targetSystem" .Values.targetSystem "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version) | indent 2 }}
{{- end }}
image: "{{ include "image-path" (dict "root" .Values "image" .Values.agents.image) }}"
imagePullPolicy: {{ .Values.agents.image.pullPolicy }}
Expand All @@ -16,7 +16,7 @@
{{ toYaml .Values.agents.containers.initContainers.resources | indent 4 }}
- name: init-config
{{- if not .Values.providers.gke.autopilot }}
{{ include "generate-security-context" (dict "securityContext" .Values.agents.containers.initContainers.securityContext "targetSystem" .Values.targetSystem "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version) | indent 2 }}
{{- include "generate-security-context" (dict "securityContext" .Values.agents.containers.initContainers.securityContext "targetSystem" .Values.targetSystem "seccomp" "" "kubeversion" .Capabilities.KubeVersion.Version) | indent 2 }}
{{- end }}
image: "{{ include "image-path" (dict "root" .Values "image" .Values.agents.image) }}"
imagePullPolicy: {{ .Values.agents.image.pullPolicy }}
Expand Down
19 changes: 17 additions & 2 deletions charts/datadog/templates/_daemonset-volumes-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
emptyDir: {}
- name: tmpdir
emptyDir: {}
{{- if not .Values.providers.gke.gdc }}
- hostPath:
path: /proc
name: procdir
- hostPath:
path: /sys/fs/cgroup
name: cgroups
{{- if and (not .Values.providers.gke.autopilot) (or .Values.datadog.systemProbe.osReleasePath .Values.datadog.osReleasePath .Values.datadog.sbom.host.enabled) }}
{{- end }}
{{- if and (not (or .Values.providers.gke.autopilot .Values.providers.gke.gdc)) (or .Values.datadog.systemProbe.osReleasePath .Values.datadog.osReleasePath .Values.datadog.sbom.host.enabled) }}
- hostPath:
path: {{ .Values.datadog.systemProbe.osReleasePath | default .Values.datadog.osReleasePath }}
name: os-release-file
Expand Down Expand Up @@ -181,6 +183,18 @@
{{- end }}
{{- end }}
{{- if or .Values.datadog.logs.enabled .Values.datadog.logsEnabled }}
{{- if .Values.providers.gke.gdc }}
- name: pointerdir
emptyDir: {}
- name: logpodpath
emptyDir: {}
- name: logscontainerspath
emptyDir: {}
{{- if not .Values.datadog.criSocketPath }}
- name: logdockercontainerpath
emptyDir: {}
{{- end }}
{{ else }}
- hostPath:
path: {{ template "datadog.hostMountRoot" . }}/logs
name: pointerdir
Expand All @@ -196,7 +210,8 @@
name: logdockercontainerpath
{{- end }}
{{- end }}
{{- if .Values.datadog.containerRuntimeSupport.enabled }}
{{- end }}
{{- if and (.Values.datadog.containerRuntimeSupport.enabled) (not .Values.providers.gke.gdc) }}
- hostPath:
path: {{ dir (include "datadog.dockerOrCriSocketPath" .) }}
name: runtimesocketdir
Expand Down
10 changes: 7 additions & 3 deletions charts/datadog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ false
Returns whether Remote Configuration should be enabled in the agent
*/}}
{{- define "datadog-remoteConfiguration-enabled" -}}
{{- if and (.Values.remoteConfiguration.enabled) (.Values.datadog.remoteConfiguration.enabled) -}}
{{- if and (.Values.remoteConfiguration.enabled) (.Values.datadog.remoteConfiguration.enabled) (not .Values.providers.gke.gdc ) -}}
true
{{- else -}}
false
Expand Down Expand Up @@ -946,7 +946,7 @@ Create RBACs for custom resources
Return true if any process-related check is enabled
*/}}
{{- define "process-checks-enabled" -}}
{{- if or .Values.datadog.processAgent.containerCollection .Values.datadog.processAgent.processCollection .Values.datadog.processAgent.processDiscovery (eq (include "language-detection-enabled" .) "true") -}}
{{- if and (or .Values.datadog.processAgent.containerCollection .Values.datadog.processAgent.processCollection .Values.datadog.processAgent.processDiscovery (eq (include "language-detection-enabled" .) "true")) (not .Values.providers.gke.gdc) -}}
true
{{- else -}}
false
Expand Down Expand Up @@ -974,6 +974,8 @@ Create RBACs for custom resources
{{- include "get-process-checks-in-core-agent-envvar" . -}}
{{- else if and (not .Values.agents.image.doNotCheckTag) .Values.datadog.processAgent.runInCoreAgent (semverCompare ">=7.53.0-0" (include "get-agent-version" .)) -}}
true
{{- else if .Values.providers.gke.gdc }}
false
{{- else -}}
false
{{- end -}}
Expand All @@ -989,8 +991,10 @@ Create RBACs for custom resources
true
{{- else if (eq (include "should-run-process-checks-on-core-agent" .) "true") -}}
false
{{- else -}}
{{- else if (not .Values.providers.gke.gdc) -}}
{{- include "process-checks-enabled" . -}}
{{- else -}}
false
{{- end -}}
{{- end -}}

Expand Down
4 changes: 3 additions & 1 deletion charts/datadog/templates/_processes-common-env.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Defines set of environment variables for Processes-related checks.
{{- define "processes-common-envs" -}}
{{- if not .Values.providers.gke.gdc }}
- name: DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED
value: {{ .Values.datadog.processAgent.processCollection | quote }}
- name: DD_PROCESS_CONFIG_CONTAINER_COLLECTION_ENABLED
Expand All @@ -11,5 +12,6 @@
{{- if and (eq .Values.targetSystem "linux") (eq (include "get-process-checks-in-core-agent-envvar" .) "") }}
- name: DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED
value: {{ (include "should-run-process-checks-on-core-agent" .) | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}
4 changes: 2 additions & 2 deletions charts/datadog/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ spec:
{{ include "containers-init-windows" . | nindent 6 }}
{{- end }}
{{- if eq .Values.targetSystem "linux" }}
{{ include "containers-init-linux" . | nindent 6 }}
{{- include "containers-init-linux" . | nindent 6 -}}
{{- end }}
{{- if and (eq (include "should-enable-system-probe" .) "true") (eq .Values.datadog.systemProbe.seccomp "localhost/system-probe") }}
{{ include "system-probe-init" . | nindent 6 }}
Expand Down Expand Up @@ -167,7 +167,7 @@ spec:
{{- if eq .Values.targetSystem "windows" }}
{{ include "daemonset-volumes-windows" . | nindent 6 }}
{{- end }}
{{- if and (eq .Values.targetSystem "linux") (not .Values.providers.gke.gdc) }}
{{- if and (eq .Values.targetSystem "linux") }}
{{ include "daemonset-volumes-linux" . | nindent 6 }}
{{- end }}
{{- if eq (include "should-enable-otel-agent" .) "true" }}
Expand Down
Loading

0 comments on commit 8cf2f58

Please sign in to comment.