Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add providers.gke.gdc option to datadog chart #1521

Merged
merged 19 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
82 changes: 48 additions & 34 deletions charts/datadog/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ You are using datadog.orchestratorExplorer.enabled but you disabled the cluster
To enable it please set clusterAgent.enabled to 'true'.
{{- end }}

{{- if .Values.providers.gke.autopilot}}
{{- if or .Values.providers.gke.autopilot .Values.providers.gke.gdc}}

{{- if not .Values.providers.gke.gdc}}

###########################################################################################
#### WARNING: Only one Datadog chart release allowed by namespace on GKE Autopilot ####
Expand All @@ -333,12 +335,23 @@ On GKE Autopilot, only one "datadog" Helm chart release is allowed by Kubernetes
* The serviceAccountName must be "datadog-agent".
* All ConfigMap names mounted must be hardcode.

{{- end }}

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

###########################################################################
#### WARNING: Cluster name must be set on Google Distributed Cloud ####
###########################################################################
{{- fail "On Google Distributed Cloud environments, cluster name must be set with `datadog.clusterName`." }}

{{- end }}

{{- if eq (include "system-probe-feature" .) "true" }}

#####################################################################
#### WARNING: System Probe is not supported on GKE Autopilot ####
#####################################################################
{{- fail "On GKE Autopilot environments, System Probe is not supported. The option 'datadog.securityAgent.runtime.enabled' must be set 'false'" }}
##################################################################################################
#### WARNING: System Probe is not supported on GKE Autopilot nor Google Distributed Cloud ####
##################################################################################################
{{- fail "On GKE Autopilot and Google Distributed Cloud environments, System Probe is not supported. The option 'datadog.securityAgent.runtime.enabled' must be set 'false'" }}

{{- end }}

Expand All @@ -354,57 +367,67 @@ The option is overriden to avoid mounting volumes that are not allowed which wou

{{- if or .Values.datadog.securityAgent.runtime.enabled .Values.datadog.securityAgent.runtime.fimEnabled }}

######################################################################################
#### WARNING: Cloud Workload Security (CWS) is not supported on GKE Autopilot ####
######################################################################################
###################################################################################################################
#### WARNING: Cloud Workload Security (CWS) is not supported on GKE Autopilot nor Google Distributed Cloud ####
###################################################################################################################

{{- fail "On GKE Autopilot environments, Cloud Workload Security (CWS) is not supported. The options 'datadog.securityAgent.runtime.enabled' and 'datadog.securityAgent.runtime.fimEnabled' must be set 'false'" }}
{{- fail "On GKE Autopilot and Google Distributed Cloud environments, Cloud Workload Security (CWS) is not supported. The options 'datadog.securityAgent.runtime.enabled' and 'datadog.securityAgent.runtime.fimEnabled' must be set 'false'" }}

{{- end }}

{{- if .Values.agents.containers.initContainers.securityContext }}

######################################################################################################
#### WARNING: Overwriting security contexts at container level not supported on GKE autopilot ####
#### WARNING: Overwriting security contexts at container level not supported on GKE Autopilot nor Google Distributed Cloud ####
######################################################################################################

{{- fail "On GKE autopilot environments, overwriting default security context is not supported, these options will be ignored" }}
{{- fail "On GKE Autopilot and Google Distributed Cloud environments, overwriting default security context is not supported, these options will be ignored" }}

{{- end }}

{{- if .Values.datadog.securityAgent.compliance.enabled }}

#################################################################################################
#### WARNING: Cloud Security Posture Management (CSPM) is not supported on GKE Autopilot ####
#################################################################################################
##############################################################################################################################
#### WARNING: Cloud Security Posture Management (CSPM) is not supported on GKE Autopilot nor Google Distributed Cloud ####
##############################################################################################################################

{{- fail "On GKE autopilot environments, Cloud Security Posture Management (CSPM) is not supported. The option 'datadog.securityAgent.compliance.enabled' must be set to 'false'" }}
{{- fail "On GKE Autopilot and Google Distributed Cloud environments, Cloud Security Posture Management (CSPM) is not supported. The option 'datadog.securityAgent.compliance.enabled' must be set to 'false'" }}

{{- end }}

{{- if .Values.datadog.dogstatsd.useSocketVolume }}

###################################################################################
#### WARNING: dogstatsd with Unix socket is not supported on GKE Autopilot ####
###################################################################################
################################################################################################################
#### WARNING: dogstatsd with Unix socket is not supported on GKE Autopilot nor Google Distributed Cloud ####
################################################################################################################

{{- end }}

{{- if .Values.datadog.apm.socketEnabled }}

##############################################################################
#### WARNING: APM with Unix socket is not supported on GKE Autopilot ####
##############################################################################
##########################################################################################################
#### WARNING: APM with Unix socket is not supported on GKE Autopilot nor Google Distributed Cloud ####
##########################################################################################################

{{- end }}

{{- if .Values.datadog.networkMonitoring.enabled }}

#######################################################################################
#### WARNING: Network Performance Monitoring is not supported on GKE Autopilot ####
#######################################################################################
####################################################################################################################
#### WARNING: Network Performance Monitoring is not supported on GKE Autopilot nor Google Distributed Cloud ####
####################################################################################################################

{{- fail "On GKE Autopilot and Google Distributed Cloud environments, Network Performance Monitoring is not supported. The option 'datadog.networkMonitoring.enabled' must be set to 'false'" }}

{{- fail "On GKE Autopilot environments, Network Performance Monitoring is not supported. The option 'datadog.networkMonitoring.enabled' must be set to 'false'" }}
{{- end }}

{{- if eq (include "should-enable-otel-agent" .) "true" }}

#################################################################
#### WARNING: Configuration notice ####
#################################################################
OTel collector is not supported on GKE Autopilot nor Google Distributed Cloud.
{{- fail "The OTel collector cannot be run on GKE Autopilot nor Google Distributed Cloud." }}

{{- end }}

Expand Down Expand Up @@ -592,15 +615,6 @@ More information about this change: https://github.com/DataDog/helm-charts/pull/
{{- end }}


{{- if and (eq (include "should-enable-otel-agent" .) "true") .Values.providers.gke.autopilot }}
#################################################################
#### WARNING: Configuration notice ####
#################################################################
OTel collector is not supported on GKE Autopilot.
{{- fail "The OTel collector cannot be run on GKE Autopilot." }}
{{- end }}


{{- if (eq (include "should-enable-otel-agent" .) "true") }}
#################################################################
#### WARNING: Private Beta notice ####
Expand Down
25 changes: 14 additions & 11 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 @@ -198,18 +197,17 @@
{{- include "additional-env-entries" .Values.agents.containers.agent.env | indent 4 }}
{{- include "additional-env-dict-entries" .Values.agents.containers.agent.envDict | indent 4 }}
volumeMounts:
{{- if not .Values.providers.gke.gdc }}
- name: logdatadog
mountPath: {{ template "datadog.logDirectoryPath" . }}
readOnly: false # Need RW to write logs
{{- end }}
{{- if eq .Values.targetSystem "linux" }}
- name: installinfo
subPath: install_info
mountPath: /etc/datadog-agent/install_info
readOnly: true
- name: tmpdir
mountPath: /tmp
readOnly: false # Need RW to write to /tmp directory
{{- 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 @@ -221,16 +219,21 @@
- 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
readOnly: false # Need RW to write to /tmp directory
{{- include "container-crisocket-volumemounts" . | nindent 4 }}
{{- end }}
{{- include "container-cloudinit-volumemounts" . | nindent 4 }}
{{- if and .Values.agents.useConfigMap (eq .Values.targetSystem "linux")}}
- name: datadog-yaml
mountPath: {{ template "datadog.confPath" . }}/datadog.yaml
subPath: datadog.yaml
readOnly: true
{{- end }}
{{- if eq .Values.targetSystem "linux" }}
{{- if and (eq .Values.targetSystem "linux") (not .Values.providers.gke.gdc)}}
- name: dsdsocket
mountPath: {{ (dir .Values.datadog.dogstatsd.socketPath) }}
readOnly: false
Expand All @@ -256,7 +259,7 @@
mountPath: /etc/passwd
readOnly: true
{{- end }}
{{- if or .Values.datadog.logs.enabled .Values.datadog.logsEnabled }}
{{- if and (or .Values.datadog.logs.enabled .Values.datadog.logsEnabled) (not .Values.providers.gke.gdc)}}
- name: pointerdir
mountPath: /opt/datadog-agent/run
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: os-release-file
mountPath: /host{{ .Values.datadog.systemProbe.osReleasePath | default .Values.datadog.osReleasePath }}
readOnly: true
{{- else if not .Values.providers.gke.autopilot}}
{{- else if not (or .Values.providers.gke.autopilot .Values.providers.gke.gdc) }}
- name: os-release-file
mountPath: /host{{ .Values.datadog.osReleasePath }}
readOnly: true
Expand Down
6 changes: 4 additions & 2 deletions charts/datadog/templates/_container-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
- name: logdatadog
mountPath: {{ template "datadog.logDirectoryPath" . }}
readOnly: false # Need RW to write logs
{{- if (not .Values.providers.gke.autopilot) }}
{{- if (not .Values.providers.gke.autopilot) }} # TODO GDC?
- name: auth-token
mountPath: {{ template "datadog.confPath" . }}/auth
readOnly: true
Expand All @@ -53,7 +53,7 @@
mountPath: {{ template "datadog.otelconfPath" . }}
readOnly: true
{{- if eq .Values.targetSystem "linux" }}
{{- if not .Values.providers.gke.autopilot }}
{{- if not (or .Values.providers.gke.autopilot .Values.providers.gke.gdc) }}
- name: procdir
mountPath: /host/proc
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
Expand All @@ -70,7 +70,9 @@
mountPath: {{ (dir .Values.datadog.dogstatsd.socketPath) }}
readOnly: true
{{- end }}
{{- if not .Values.providers.gke.gdc }}
{{- include "container-crisocket-volumemounts" . | nindent 4 }}
{{- end }}
{{- include "container-cloudinit-volumemounts" . | nindent 4 }}
{{- if .Values.datadog.kubelet.hostCAPath }}
{{ include "datadog.kubelet.volumeMount" . | indent 4 }}
Expand Down
8 changes: 6 additions & 2 deletions charts/datadog/templates/_container-process-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- name: config
mountPath: {{ template "datadog.confPath" . }}
readOnly: true
{{- if not .Values.providers.gke.gdc }}
- name: logdatadog
mountPath: {{ template "datadog.logDirectoryPath" . }}
readOnly: false # Need RW to write logs
Expand All @@ -57,23 +58,25 @@
- name: auth-token
mountPath: {{ template "datadog.confPath" . }}/auth
readOnly: true
{{- end }}
- name: dsdsocket
mountPath: {{ (dir .Values.datadog.dogstatsd.socketPath) }}
readOnly: false # Need RW for UDS DSD socket
{{- end }}
{{- include "container-crisocket-volumemounts" . | nindent 4 }}
- name: tmpdir
mountPath: /tmp
readOnly: false # Need RW to write to tmp directory
{{- include "linux-container-host-release-volumemounts" . | nindent 4 }}
{{- end }}
{{- include "container-crisocket-volumemounts" . | nindent 4 }}
{{- end }}
{{- include "container-cloudinit-volumemounts" . | nindent 4 }}
{{- if and .Values.agents.useConfigMap (eq .Values.targetSystem "linux")}}
- name: datadog-yaml
mountPath: {{ template "datadog.confPath" . }}/datadog.yaml
subPath: datadog.yaml
readOnly: true
{{- end }}
{{- if not .Values.providers.gke.gdc }}
{{- if eq .Values.targetSystem "linux" }}
- name: cgroups
mountPath: /host/sys/fs/cgroup
Expand All @@ -88,6 +91,7 @@
mountPath: /host/proc
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
readOnly: true
{{- end }}
{{- if eq (include "should-enable-system-probe" .) "true" }}
- name: sysprobe-socket-dir
mountPath: /var/run/sysprobe
Expand Down
2 changes: 2 additions & 0 deletions charts/datadog/templates/_container-security-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
- name: auth-token
mountPath: {{ template "datadog.confPath" . }}/auth
readOnly: true
{{- end }}
{{- if not (or .Values.providers.gke.autopilot .Values.providers.gke.gdc) }}
- name: dsdsocket
mountPath: {{ (dir .Values.datadog.dogstatsd.socketPath) }}
readOnly: false # Need RW for UDS DSD socket
Expand Down
4 changes: 3 additions & 1 deletion charts/datadog/templates/_container-trace-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
readOnly: true
{{- end }}
{{- if eq .Values.targetSystem "linux" }}
{{- if not .Values.providers.gke.autopilot }}
{{- if not (or .Values.providers.gke.autopilot .Values.providers.gke.gdc) }}
- name: procdir
mountPath: /host/proc
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
Expand All @@ -96,6 +96,7 @@
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
readOnly: true
{{- end }}
{{- if not .Values.providers.gke.gdc }}
- name: tmpdir
mountPath: /tmp
readOnly: false # Need RW for tmp directory
Expand All @@ -109,6 +110,7 @@
{{- end }}
{{- end }}
{{- include "container-crisocket-volumemounts" . | nindent 4 }}
{{- end }}
{{- include "container-cloudinit-volumemounts" . | nindent 4 }}
{{- if .Values.datadog.kubelet.hostCAPath }}
{{ include "datadog.kubelet.volumeMount" . | indent 4 }}
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
Loading
Loading