Skip to content

Commit 9603406

Browse files
authored
Reapply "Add PodResources mount (#1696)" (#1714)
* Reapply "Add PodResources mount" (#1708) This reverts commit 645031f. * Mount only for non-windows, non-gke * Fix for GDC and autopilot * Fix setting * Update baselines * Update baselines
1 parent 64e474e commit 9603406

11 files changed

+65
-2
lines changed

charts/datadog/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Datadog changelog
22

3+
## 3.102.0
4+
5+
* Add a mount for the Kubernetes PodResources socket.
6+
37
## 3.101.1
48

59
* Add the `NVIDIA_VISIBLE_DEVICES` environment variable to the containers when GPU monitoring is enabled: if the NVIDIA k8s device plugin does not support volume mounts for requesting devices (controlled by the `accept-nvidia-visible-devices-as-volume-mount` setting) we need to request devices via the environment variable.

charts/datadog/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
apiVersion: v1
33
name: datadog
4-
version: 3.101.1
4+
version: 3.102.0
55
appVersion: "7"
66
description: Datadog Agent
77
keywords:

charts/datadog/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Datadog
22

3-
![Version: 3.101.1](https://img.shields.io/badge/Version-3.101.1-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
3+
![Version: 3.102.0](https://img.shields.io/badge/Version-3.102.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

@@ -778,6 +778,7 @@ helm install <RELEASE_NAME> \
778778
| datadog.kubelet.host | object | `{"valueFrom":{"fieldRef":{"fieldPath":"status.hostIP"}}}` | Override kubelet IP |
779779
| datadog.kubelet.hostCAPath | string | None (no mount from host) | Path (on host) where the Kubelet CA certificate is stored |
780780
| datadog.kubelet.podLogsPath | string | /var/log/pods on Linux, C:\var\log\pods on Windows | Path (on host) where the PODs logs are located |
781+
| datadog.kubelet.podResourcesSocketDir | string | /var/lib/kubelet/pod-resources | Path (on host) where the kubelet.sock socket for the PodResources API is located |
781782
| datadog.kubelet.tlsVerify | string | true | Toggle kubelet TLS verification |
782783
| datadog.kubernetesEvents.collectedEventTypes | list | `[{"kind":"Pod","reasons":["Failed","BackOff","Unhealthy","FailedScheduling","FailedMount","FailedAttachVolume"]},{"kind":"Node","reasons":["TerminatingEvictedPod","NodeNotReady","Rebooted","HostPortConflict"]},{"kind":"CronJob","reasons":["SawCompletedJob"]}]` | Event types to be collected. This requires datadog.kubernetesEvents.unbundleEvents to be set to true. |
783784
| datadog.kubernetesEvents.filteringEnabled | bool | `false` | Enable this to only include events that match the pre-defined allowed events. (Requires Cluster Agent 7.57.0+). |

charts/datadog/templates/_container-agent.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@
205205
- name: DD_OTELCOLLECTOR_ENABLED
206206
value: "true"
207207
{{- end }}
208+
{{- if and (not .Values.providers.gke.gdc) (not .Values.providers.gke.autopilot) }}
209+
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
210+
value: {{ printf "%s/kubelet.sock" .Values.datadog.kubelet.podResourcesSocketDir | quote }}
211+
{{- end }}
208212
{{- if .Values.datadog.gpuMonitoring.enabled }}
209213
# depending on the NVIDIA container toolkit configuration, we might need to request visible devices via this env var or via the /var/run/nvidia-container-devices/all volume mount
210214
- name: NVIDIA_VISIBLE_DEVICES
@@ -246,6 +250,11 @@
246250
readOnly: true
247251
{{- end }}
248252
{{- if eq .Values.targetSystem "linux" }}
253+
{{- if and (not .Values.providers.gke.gdc) (not .Values.providers.gke.autopilot) }}
254+
- name: pod-resources-socket
255+
mountPath: {{ .Values.datadog.kubelet.podResourcesSocketDir }}
256+
readOnly: false
257+
{{- end }}
249258
{{- if not .Values.providers.gke.gdc }}
250259
- name: dsdsocket
251260
mountPath: {{ (dir .Values.datadog.dogstatsd.socketPath) }}

charts/datadog/templates/_daemonset-volumes-linux.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
configMap:
1111
name: {{ include "agents.confd-configmap-name" . }}
1212
{{- end }}
13+
{{- if and (not .Values.providers.gke.gdc) (not .Values.providers.gke.autopilot) }}
14+
- name: pod-resources-socket
15+
hostPath:
16+
path: {{ .Values.datadog.kubelet.podResourcesSocketDir }}
17+
{{- end }}
1318
{{- if not .Values.providers.gke.gdc }}
1419
- hostPath:
1520
path: /proc

charts/datadog/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ datadog:
313313
# datadog.kubelet.coreCheckEnabled -- Toggle if kubelet core check should be used instead of Python check. (Requires Agent/Cluster Agent 7.53.0+)
314314
# @default -- true
315315
coreCheckEnabled: true
316+
# datadog.kubelet.podResourcesSocketDir -- Path (on host) where the kubelet.sock socket for the PodResources API is located
317+
# @default -- /var/lib/kubelet/pod-resources
318+
podResourcesSocketDir: /var/lib/kubelet/pod-resources
319+
316320

317321
# datadog.expvarPort -- Specify the port to expose pprof and expvar to not interfere with the agent metrics port from the cluster-agent, which defaults to 5000
318322
expvarPort: 6000

test/datadog/baseline/daemonset_default.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ spec:
111111
value: "true"
112112
- name: DD_KUBELET_CORE_CHECK_ENABLED
113113
value: "true"
114+
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
115+
value: /var/lib/kubelet/pod-resources/kubelet.sock
114116
image: gcr.io/datadoghq/agent:7.63.2
115117
imagePullPolicy: IfNotPresent
116118
livenessProbe:
@@ -173,6 +175,9 @@ spec:
173175
mountPropagation: None
174176
name: runtimesocketdir
175177
readOnly: true
178+
- mountPath: /var/lib/kubelet/pod-resources
179+
name: pod-resources-socket
180+
readOnly: false
176181
- mountPath: /var/run/datadog
177182
name: dsdsocket
178183
readOnly: false
@@ -371,6 +376,9 @@ spec:
371376
name: tmpdir
372377
- emptyDir: {}
373378
name: s6-run
379+
- hostPath:
380+
path: /var/lib/kubelet/pod-resources
381+
name: pod-resources-socket
374382
- hostPath:
375383
path: /proc
376384
name: procdir

test/datadog/baseline/manifests/agent-clusterchecks-deployment_default.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,8 @@ spec:
851851
value: "true"
852852
- name: DD_KUBELET_CORE_CHECK_ENABLED
853853
value: "true"
854+
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
855+
value: /var/lib/kubelet/pod-resources/kubelet.sock
854856
image: gcr.io/datadoghq/agent:7.63.2
855857
imagePullPolicy: IfNotPresent
856858
livenessProbe:
@@ -913,6 +915,9 @@ spec:
913915
mountPropagation: None
914916
name: runtimesocketdir
915917
readOnly: true
918+
- mountPath: /var/lib/kubelet/pod-resources
919+
name: pod-resources-socket
920+
readOnly: false
916921
- mountPath: /var/run/datadog
917922
name: dsdsocket
918923
readOnly: false
@@ -1111,6 +1116,9 @@ spec:
11111116
name: tmpdir
11121117
- emptyDir: {}
11131118
name: s6-run
1119+
- hostPath:
1120+
path: /var/lib/kubelet/pod-resources
1121+
name: pod-resources-socket
11141122
- hostPath:
11151123
path: /proc
11161124
name: procdir

test/datadog/baseline/manifests/daemonset_default.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,8 @@ spec:
816816
value: "true"
817817
- name: DD_KUBELET_CORE_CHECK_ENABLED
818818
value: "true"
819+
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
820+
value: /var/lib/kubelet/pod-resources/kubelet.sock
819821
image: gcr.io/datadoghq/agent:7.63.2
820822
imagePullPolicy: IfNotPresent
821823
livenessProbe:
@@ -878,6 +880,9 @@ spec:
878880
mountPropagation: None
879881
name: runtimesocketdir
880882
readOnly: true
883+
- mountPath: /var/lib/kubelet/pod-resources
884+
name: pod-resources-socket
885+
readOnly: false
881886
- mountPath: /var/run/datadog
882887
name: dsdsocket
883888
readOnly: false
@@ -1076,6 +1081,9 @@ spec:
10761081
name: tmpdir
10771082
- emptyDir: {}
10781083
name: s6-run
1084+
- hostPath:
1085+
path: /var/lib/kubelet/pod-resources
1086+
name: pod-resources-socket
10791087
- hostPath:
10801088
path: /proc
10811089
name: procdir

test/datadog/baseline/manifests/default_all.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,8 @@ spec:
816816
value: "true"
817817
- name: DD_KUBELET_CORE_CHECK_ENABLED
818818
value: "true"
819+
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
820+
value: /var/lib/kubelet/pod-resources/kubelet.sock
819821
image: gcr.io/datadoghq/agent:7.63.2
820822
imagePullPolicy: IfNotPresent
821823
livenessProbe:
@@ -878,6 +880,9 @@ spec:
878880
mountPropagation: None
879881
name: runtimesocketdir
880882
readOnly: true
883+
- mountPath: /var/lib/kubelet/pod-resources
884+
name: pod-resources-socket
885+
readOnly: false
881886
- mountPath: /var/run/datadog
882887
name: dsdsocket
883888
readOnly: false
@@ -1076,6 +1081,9 @@ spec:
10761081
name: tmpdir
10771082
- emptyDir: {}
10781083
name: s6-run
1084+
- hostPath:
1085+
path: /var/lib/kubelet/pod-resources
1086+
name: pod-resources-socket
10791087
- hostPath:
10801088
path: /proc
10811089
name: procdir

test/datadog/baseline/manifests/other_default.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,8 @@ spec:
816816
value: "true"
817817
- name: DD_KUBELET_CORE_CHECK_ENABLED
818818
value: "true"
819+
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
820+
value: /var/lib/kubelet/pod-resources/kubelet.sock
819821
image: gcr.io/datadoghq/agent:7.63.2
820822
imagePullPolicy: IfNotPresent
821823
livenessProbe:
@@ -878,6 +880,9 @@ spec:
878880
mountPropagation: None
879881
name: runtimesocketdir
880882
readOnly: true
883+
- mountPath: /var/lib/kubelet/pod-resources
884+
name: pod-resources-socket
885+
readOnly: false
881886
- mountPath: /var/run/datadog
882887
name: dsdsocket
883888
readOnly: false
@@ -1076,6 +1081,9 @@ spec:
10761081
name: tmpdir
10771082
- emptyDir: {}
10781083
name: s6-run
1084+
- hostPath:
1085+
path: /var/lib/kubelet/pod-resources
1086+
name: pod-resources-socket
10791087
- hostPath:
10801088
path: /proc
10811089
name: procdir

0 commit comments

Comments
 (0)