Skip to content

Commit

Permalink
Merge branch 'main' into robertjli/PROCS-4380-cint-codeowner
Browse files Browse the repository at this point in the history
  • Loading branch information
khewonc authored Dec 9, 2024
2 parents b6e0b24 + 49c13ec commit 5f290d6
Show file tree
Hide file tree
Showing 34 changed files with 185 additions and 36 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

## 2.4.0

* Add configuration to grant the necessary RBAC to the operator for the CWS Instrumentation Admission Controller feature in the Cluster-Agent.

## 2.3.0

* Update Datadog Operator version to 1.10.0.
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: 2.3.0
version: 2.4.0
appVersion: 1.10.0
description: Datadog Operator
keywords:
Expand Down
4 changes: 2 additions & 2 deletions charts/datadog-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog Operator

![Version: 2.3.0](https://img.shields.io/badge/Version-2.3.0-informational?style=flat-square) ![AppVersion: 1.10.0](https://img.shields.io/badge/AppVersion-1.10.0-informational?style=flat-square)
![Version: 2.4.0](https://img.shields.io/badge/Version-2.4.0-informational?style=flat-square) ![AppVersion: 1.10.0](https://img.shields.io/badge/AppVersion-1.10.0-informational?style=flat-square)

## Values

Expand All @@ -12,7 +12,7 @@
| appKey | string | `nil` | Your Datadog APP key |
| appKeyExistingSecret | string | `nil` | Use existing Secret which stores APP key instead of creating a new one |
| clusterName | string | `nil` | Set a unique cluster name reporting from the Datadog Operator. |
| clusterRole | object | `{"allowReadAllResources":false}` | Set specific configuration for the cluster role |
| clusterRole | object | `{"allowCreatePodsExec":false,"allowReadAllResources":false}` | Set specific configuration for the cluster role |
| collectOperatorMetrics | bool | `true` | Configures an openmetrics check to collect operator metrics |
| containerSecurityContext | object | `{}` | A security context defines privileges and access control settings for a container. |
| datadogAgent.enabled | bool | `true` | Enables Datadog Agent controller |
Expand Down
5 changes: 5 additions & 0 deletions charts/datadog-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -803,4 +803,9 @@ rules:
- list
- watch
{{- end }}
{{- if .Values.clusterRole.allowCreatePodsExec }}
- apiGroups: [""]
resources: ["pods/exec"]
verbs: ["create"]
{{- end }}
{{- end -}}
3 changes: 3 additions & 0 deletions charts/datadog-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,6 @@ clusterRole:
# allowReadAllResources is required to allow the operator to view all custom resources.
# If collecting CRDs in the Kubernetes Explorer this is required
allowReadAllResources: false

# allowCreatePodsExec is required for `remote_copy` mode of the CWS Instrumentation feature.
allowCreatePodsExec: false
18 changes: 18 additions & 0 deletions charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Datadog changelog

## 3.83.0

* Added the configuration value `datadog.disablePasswdMount` to disable mounting the `/etc/passwd` path from the host filesystem. This option should be used when the underlying OS does not have these files (e.g., Talos OS).
* Added the configuration value `datadog.disableDefaultOsReleasePaths` to disable mounting the default "os-release" file paths from the host filesystem (e.g., `/etc/redhat-release`, `/etc/fedora-release`, etc.). Note that this change does not affect the `datadog.osReleasePath` option. To avoid mounting the `/etc/os-release` host path, set the `datadog.osReleasePath` configuration value to an empty string. This option should be used when the underlying OS does not have these files (e.g., Talos OS).
* Add `providers.talos.enabled` to simplify agent deployment configuration on Talos OS.

## 3.82.0

* Add `pods/exec` RBAC to the `Cluster-Agent` when needed and inject the service account name of the `Cluster-Agent` as environment variable.

## 3.81.2

* Fix ci values.yaml files name to be taken into account by the ci job.

## 3.81.1

* Update default `fips.image.tag` to `1.1.6`, which updates PCRE2 version to 10.44 and HAProxy version to 2.4.28

## 3.81.0

* Add a new option to disable hostPorts for the trace-agent with `datadog.apm.useLocalService`. This option enables K8s clusters with hostPort and hostPath volumes restrictions to use the K8s local service to send traces.
Expand Down
3 changes: 2 additions & 1 deletion charts/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
apiVersion: v1
name: datadog
version: 3.81.0
version: 3.83.0
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
9 changes: 7 additions & 2 deletions charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.81.0](https://img.shields.io/badge/Version-3.81.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.83.0](https://img.shields.io/badge/Version-3.83.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 @@ -571,6 +571,8 @@ helm install <RELEASE_NAME> \
| clusterAgent.admissionController.agentSidecarInjection.selectors | list | `[]` | Defines the pod selector for sidecar injection, currently only one rule is supported. |
| clusterAgent.admissionController.configMode | string | `nil` | The kind of configuration to be injected, it can be "hostip", "service", or "socket". |
| clusterAgent.admissionController.containerRegistry | string | `nil` | Override the default registry for the admission controller. |
| clusterAgent.admissionController.cwsInstrumentation.enabled | bool | `false` | Enable the CWS Instrumentation admission controller endpoint. |
| clusterAgent.admissionController.cwsInstrumentation.mode | string | `"remote_copy"` | Mode defines how the CWS Instrumentation should behave. Options are "remote_copy" or "init_container" |
| clusterAgent.admissionController.enabled | bool | `true` | Enable the admissionController to be able to inject APM/Dogstatsd config and standard tags (env, service, version) automatically into your pods |
| clusterAgent.admissionController.failurePolicy | string | `"Ignore"` | Set the failure policy for dynamic admission control.' |
| clusterAgent.admissionController.mutateUnlabelled | bool | `false` | Enable injecting config without having the pod label 'admission.datadoghq.com/enabled="true"' |
Expand Down Expand Up @@ -725,6 +727,8 @@ helm install <RELEASE_NAME> \
| datadog.containerRuntimeSupport.enabled | bool | `true` | Set this to false to disable agent access to container runtime. |
| datadog.criSocketPath | string | `nil` | Path to the container runtime socket (if different from Docker) |
| datadog.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 |
| datadog.disableDefaultOsReleasePaths | bool | `false` | Set this to true to disable mounting datadog.osReleasePath in all containers |
| datadog.disablePasswdMount | bool | `false` | Set this to true to disable mounting /etc/passwd in all containers |
| datadog.dockerSocketPath | string | `nil` | Path to the docker socket |
| datadog.dogstatsd.hostSocketPath | string | `"/var/run/datadog/"` | Host path to the DogStatsD socket |
| datadog.dogstatsd.nonLocalTraffic | bool | `true` | Enable this to make each node accept non-local statsd traffic (from outside of the pod) |
Expand Down Expand Up @@ -876,7 +880,7 @@ helm install <RELEASE_NAME> \
| fips.image.name | string | `"fips-proxy"` | |
| fips.image.pullPolicy | string | `"IfNotPresent"` | Datadog the FIPS sidecar image pull policy |
| fips.image.repository | string | `nil` | Override default registry + image.name for the FIPS sidecar container. |
| fips.image.tag | string | `"1.1.5"` | Define the FIPS sidecar container version to use. |
| fips.image.tag | string | `"1.1.6"` | Define the FIPS sidecar container version to use. |
| fips.local_address | string | `"127.0.0.1"` | Set local IP address |
| fips.port | int | `9803` | Specifies which port is used by the containers to communicate to the FIPS sidecar. |
| fips.portRange | int | `15` | Specifies the number of ports used, defaults to 13 https://github.com/DataDog/datadog-agent/blob/7.44.x/pkg/config/config.go#L1564-L1577 |
Expand All @@ -895,6 +899,7 @@ helm install <RELEASE_NAME> \
| 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) |
| providers.talos.enabled | bool | `false` | Activate all required specificities related to Talos.dev configuration, as currently the chart cannot auto-detect Talos.dev cluster. Note: The Agent deployment requires additional privileges that are not permitted by the default pod security policy. The annotation `pod-security.kubernetes.io/enforce=privileged` must be applied to the Datadog installation Kubernetes namespace. For more information on pod security policies in Talos.dev clusters, see: https://www.talos.dev/v1.8/kubernetes-guides/configuration/pod-security/ |
| 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) |
| 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ datadog:
appKey: "0000000000000000000000000000000000000000"
orchestratorExplorer:
customResources:
- datadoghq.com/v1alpha1/datadogpodautoscalers
- datadoghq.com/v1alpha1/datadogpodautoscalers
autoscaling:
workload:
enabled: true
Expand All @@ -12,3 +12,4 @@ datadog:
clusterAgent:
image:
tag: beta
doNotCheckTag: true
4 changes: 4 additions & 0 deletions charts/datadog/ci/disable-defaultosreleasepath-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
datadog:
apiKey: "00000000000000000000000000000000"
appKey: "0000000000000000000000000000000000000000"
disableDefaultOsReleasePaths: true
9 changes: 9 additions & 0 deletions charts/datadog/ci/image-digest-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
clusterAgent:
image:
digest: sha256:28a5e138123e273643527341c3e38721cec2d89a472958df8e956ae681c10d75 # corresponds to 7.59.0
agents:
image:
digest: sha256:9b4be18f644bd35dad2387f37d9859674080889642b970c0e924d027c4182f6d # corresponds to 7.59.0
clusterChecksRunner:
image:
digest: sha256:9b4be18f644bd35dad2387f37d9859674080889642b970c0e924d027c4182f6d # corresponds to 7.59.0
9 changes: 0 additions & 9 deletions charts/datadog/ci/image-digest.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ datadog:
receiver:
protocols:
grpc:
enabled: true
enabled: true
http:
enabled: true
8 changes: 8 additions & 0 deletions charts/datadog/ci/provider-talos-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
datadog:
apiKey: "00000000000000000000000000000000"
appKey: "0000000000000000000000000000000000000000"

providers:
talos:
enabled: true
19 changes: 19 additions & 0 deletions charts/datadog/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,25 @@ More information about this change: https://github.com/DataDog/helm-charts/pull/
{{- end }}


{{- if and (eq .Values.targetSystem "linux") (eq .Values.datadog.osReleasePath "") (eq (include "should-add-host-path-for-os-release-paths" .) "false") .Values.datadog.sbom.host.enabled }}
#################################################################
#### ERROR: Configuration notice ####
#################################################################
The SBOM host filesystem collection feature requires access to the os-release information from the host.
`datadog.sbom.host.enabled: true` can't be used with `datadog.disableDefaultOsReleasePaths: true`.
{{- fail "The SBOM host filesystem collection feature requires access to the os-release information from the host." }}
{{- end }}

{{- if and (eq .Values.targetSystem "linux") (eq .Values.datadog.osReleasePath "") (eq (include "should-add-host-path-for-os-release-paths" .) "false") (eq (include "should-enable-system-probe" .) "true") }}
#################################################################
#### ERROR: Configuration notice ####
#################################################################
The current set of options used to install the chart requires the system-probe container to be enabled.
However, the `datadog.disableDefaultOsReleasePaths` option set to `true` and `datadog.osReleasePath` is empty which is not compatible when the system-probe container is required.
{{- fail "OS Release information is required when system-probe is enabled." }}
{{- end }}


{{- $hasContainerIncludeEnv := false }}
{{- range $key := .Values.datadog.env }}
{{- if eq $key.name "DD_CONTAINER_INCLUDE" }}
Expand Down
4 changes: 3 additions & 1 deletion charts/datadog/templates/_container-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
mountPath: /host/sys/fs/cgroup
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
readOnly: true
{{- if (eq (include "should-run-process-checks-on-core-agent" .) "true") }}
{{- if and (eq (include "should-add-host-path-for-etc-passwd" .) "true") (eq (include "should-run-process-checks-on-core-agent" .) "true") }}
- name: passwd
mountPath: /etc/passwd
readOnly: true
Expand Down Expand Up @@ -302,6 +302,7 @@
- name: host-rpm-dir
mountPath: /host/var/lib/rpm
readOnly: true
{{- if eq (include "should-add-host-path-for-os-release-paths" .) "true" }}
{{- if ne .Values.datadog.osReleasePath "/etc/redhat-release" }}
- name: etc-redhat-release
mountPath: /host/etc/redhat-release
Expand All @@ -324,6 +325,7 @@
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if eq .Values.targetSystem "windows" }}
{{- if or .Values.datadog.logs.enabled .Values.datadog.logsEnabled }}
- name: pointerdir
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{{- define "linux-container-host-release-volumemounts" -}}
{{- if not .Values.providers.gke.gdc }}
{{- if eq (include "should-enable-system-probe" .) "true" }}
{{- if or .Values.datadog.osReleasePath .Values.datadog.systemProbe.osReleasePath }}
{{- if and (not .Values.providers.gke.gdc) (not .Values.providers.gke.autopilot) }}
{{- if eq (include "should-enable-system-probe" .) "true" }}
- 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 .Values.datadog.osReleasePath }}
- name: os-release-file
mountPath: /host{{ .Values.datadog.osReleasePath }}
readOnly: true
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/datadog/templates/_container-process-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
mountPath: /host/sys/fs/cgroup
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
readOnly: true
{{- if or .Values.datadog.processAgent.processCollection .Values.datadog.processAgent.processDiscovery .Values.datadog.processAgent.containerCollection}}
{{- if and (eq (include "should-add-host-path-for-etc-passwd" .) "true") (or .Values.datadog.processAgent.processCollection .Values.datadog.processAgent.processDiscovery .Values.datadog.processAgent.containerCollection) }}
- name: passwd
mountPath: /etc/passwd
readOnly: true
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 @@ -91,9 +91,11 @@
- name: cgroups
mountPath: /host/sys/fs/cgroup
readOnly: true
{{- if (eq (include "should-add-host-path-for-etc-passwd" .) "true") }}
- name: passwd
mountPath: /etc/passwd
readOnly: true
{{- end }}
- name: group
mountPath: /etc/group
readOnly: true
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/templates/_container-system-probe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
readOnly: true
{{- include "linux-container-host-release-volumemounts" . | nindent 4 }}
{{- if .Values.datadog.systemProbe.enableDefaultOsReleasePaths }}
{{- if (eq (include "should-add-host-path-for-os-release-paths" .) "true") }}
{{- if ne .Values.datadog.osReleasePath "/etc/redhat-release" }}
- name: etc-redhat-release
mountPath: /host/etc/redhat-release
Expand Down
4 changes: 2 additions & 2 deletions charts/datadog/templates/_daemonset-volumes-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
path: {{ .Values.datadog.systemProbe.osReleasePath | default .Values.datadog.osReleasePath }}
name: os-release-file
{{- end }}
{{- if or (and (eq (include "should-enable-system-probe" .) "true") .Values.datadog.systemProbe.enableDefaultOsReleasePaths) .Values.datadog.sbom.host.enabled }}
{{- if and (eq (include "should-add-host-path-for-os-release-paths" .) "true") (or (eq (include "should-enable-system-probe" .) "true") .Values.datadog.sbom.host.enabled) }}
- hostPath:
path: /etc/redhat-release
name: etc-redhat-release
Expand Down Expand Up @@ -138,7 +138,7 @@
name: btf-path
{{- end }}
{{- end }}
{{- if or (eq (include "process-checks-enabled" .) "true") (eq (include "should-run-process-checks-on-core-agent" .) "true") (eq (include "should-enable-system-probe" .) "true") (eq (include "should-enable-security-agent" .) "true") }}
{{- if and (eq (include "should-add-host-path-for-etc-passwd" .) "true") (or (eq (include "process-checks-enabled" .) "true") (eq (include "should-run-process-checks-on-core-agent" .) "true") (eq (include "should-enable-system-probe" .) "true") (eq (include "should-enable-security-agent" .) "true")) }}
- hostPath:
path: /etc/passwd
name: passwd
Expand Down
34 changes: 33 additions & 1 deletion charts/datadog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,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) (not .Values.providers.gke.gdc ) -}}
{{- if and (.Values.remoteConfiguration.enabled) (.Values.datadog.remoteConfiguration.enabled) (not .Values.providers.gke.gdc) -}}
true
{{- else -}}
false
Expand Down Expand Up @@ -1045,3 +1045,35 @@ Create RBACs for custom resources
{{- end -}}
{{- end -}}
{{- end -}}


{{/*
Returns true if Host paths for default OS Release Paths need to be added to the volumes.
*/}}
{{- define "should-add-host-path-for-os-release-paths" -}}
{{- if ne .Values.targetSystem "linux" -}}
false
{{- else if .Values.providers.talos.enabled -}}
false
{{- else if (and .Values.datadog.systemProbe.enableDefaultOsReleasePaths (not .Values.datadog.disableDefaultOsReleasePaths)) -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}


{{/*
Returns true if the host file /etc/passwd should be mounted, else return false.
*/}}
{{- define "should-add-host-path-for-etc-passwd" -}}
{{- if ne .Values.targetSystem "linux" -}}
false
{{- else if .Values.providers.talos.enabled -}}
false
{{- else if not .Values.datadog.disablePasswdMount -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}
10 changes: 10 additions & 0 deletions charts/datadog/templates/cluster-agent-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: DD_CLUSTER_AGENT_SERVICE_ACCOUNT_NAME
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- name: DD_HEALTH_PORT
{{- $healthPort := .Values.clusterAgent.healthPort }}
value: {{ $healthPort | quote }}
Expand Down Expand Up @@ -248,6 +252,12 @@ spec:
{{- else }}
value: {{ include "registry" .Values | quote }}
{{- end }}
{{- if .Values.clusterAgent.admissionController.cwsInstrumentation.enabled }}
- name: DD_ADMISSION_CONTROLLER_CWS_INSTRUMENTATION_ENABLED
value: "true"
- name: DD_ADMISSION_CONTROLLER_CWS_INSTRUMENTATION_MODE
value: {{ .Values.clusterAgent.admissionController.cwsInstrumentation.mode | quote }}
{{- end }}
{{ include "ac-agent-sidecar-env" . | nindent 10 }}
- name: DD_REMOTE_CONFIGURATION_ENABLED
value: {{ include "clusterAgent-remoteConfiguration-enabled" . | quote }}
Expand Down
Loading

0 comments on commit 5f290d6

Please sign in to comment.