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

Reapply "Add PodResources mount (#1696)" #1714

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Datadog changelog

## 3.101.0

* Add a mount for the Kubernetes PodResources socket.
## 3.100.0

* Enable `system-probe` container on GKE Autopilot (requires GKE 1.32.1-gke.1729000 or later).
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v1
name: datadog
version: 3.100.0
version: 3.101.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.100.0](https://img.shields.io/badge/Version-3.100.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.101.0](https://img.shields.io/badge/Version-3.101.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 @@ -778,6 +778,7 @@ helm install <RELEASE_NAME> \
| datadog.kubelet.host | object | `{"valueFrom":{"fieldRef":{"fieldPath":"status.hostIP"}}}` | Override kubelet IP |
| datadog.kubelet.hostCAPath | string | None (no mount from host) | Path (on host) where the Kubelet CA certificate is stored |
| datadog.kubelet.podLogsPath | string | /var/log/pods on Linux, C:\var\log\pods on Windows | Path (on host) where the PODs logs are located |
| datadog.kubelet.podResourcesSocketDir | string | /var/lib/kubelet/pod-resources | Path (on host) where the kubelet.sock socket for the PodResources API is located |
| datadog.kubelet.tlsVerify | string | true | Toggle kubelet TLS verification |
| 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. |
| datadog.kubernetesEvents.filteringEnabled | bool | `false` | Enable this to only include events that match the pre-defined allowed events. (Requires Cluster Agent 7.57.0+). |
Expand Down
11 changes: 10 additions & 1 deletion charts/datadog/templates/_container-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
value: {{ .Values.datadog.checksCardinality | quote }}
{{- end }}
- name: DD_CONTAINER_LIFECYCLE_ENABLED
value: {{ .Values.datadog.containerLifecycle.enabled | quote | default "true" }}
value: {{ .Values.datadog.containerLifecycle.enabled | quote | default "true" }}
- name: DD_ORCHESTRATOR_EXPLORER_ENABLED
value: {{ (include "should-enable-k8s-resource-monitoring" .) | quote }}
- name: DD_EXPVAR_PORT
Expand Down Expand Up @@ -205,6 +205,10 @@
- name: DD_OTELCOLLECTOR_ENABLED
value: "true"
{{- end }}
{{- if and (not .Values.providers.gke.gdc) (not .Values.providers.gke.autopilot) }}
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
value: {{ printf "%s/kubelet.sock" .Values.datadog.kubelet.podResourcesSocketDir | quote }}
{{- end }}
{{- include "additional-env-entries" .Values.agents.containers.agent.env | indent 4 }}
{{- include "additional-env-dict-entries" .Values.agents.containers.agent.envDict | indent 4 }}
volumeMounts:
Expand Down Expand Up @@ -241,6 +245,11 @@
readOnly: true
{{- end }}
{{- if eq .Values.targetSystem "linux" }}
{{- if and (not .Values.providers.gke.gdc) (not .Values.providers.gke.autopilot) }}
- name: pod-resources-socket
mountPath: {{ .Values.datadog.kubelet.podResourcesSocketDir }}
readOnly: false
{{- end }}
{{- if not .Values.providers.gke.gdc }}
- name: dsdsocket
mountPath: {{ (dir .Values.datadog.dogstatsd.socketPath) }}
Expand Down
5 changes: 5 additions & 0 deletions charts/datadog/templates/_daemonset-volumes-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
configMap:
name: {{ include "agents.confd-configmap-name" . }}
{{- end }}
{{- if and (not .Values.providers.gke.gdc) (not .Values.providers.gke.autopilot) }}
- name: pod-resources-socket
hostPath:
path: {{ .Values.datadog.kubelet.podResourcesSocketDir }}
{{- end }}
{{- if not .Values.providers.gke.gdc }}
- hostPath:
path: /proc
Expand Down
4 changes: 4 additions & 0 deletions charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ datadog:
# datadog.kubelet.coreCheckEnabled -- Toggle if kubelet core check should be used instead of Python check. (Requires Agent/Cluster Agent 7.53.0+)
# @default -- true
coreCheckEnabled: true
# datadog.kubelet.podResourcesSocketDir -- Path (on host) where the kubelet.sock socket for the PodResources API is located
# @default -- /var/lib/kubelet/pod-resources
podResourcesSocketDir: /var/lib/kubelet/pod-resources


# 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
expvarPort: 6000
Expand Down
8 changes: 8 additions & 0 deletions test/datadog/baseline/daemonset_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ spec:
value: "true"
- name: DD_KUBELET_CORE_CHECK_ENABLED
value: "true"
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
value: /var/lib/kubelet/pod-resources/kubelet.sock
image: gcr.io/datadoghq/agent:7.63.2
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -173,6 +175,9 @@ spec:
mountPropagation: None
name: runtimesocketdir
readOnly: true
- mountPath: /var/lib/kubelet/pod-resources
name: pod-resources-socket
readOnly: false
- mountPath: /var/run/datadog
name: dsdsocket
readOnly: false
Expand Down Expand Up @@ -371,6 +376,9 @@ spec:
name: tmpdir
- emptyDir: {}
name: s6-run
- hostPath:
path: /var/lib/kubelet/pod-resources
name: pod-resources-socket
- hostPath:
path: /proc
name: procdir
Expand Down
8 changes: 8 additions & 0 deletions test/datadog/baseline/default_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,8 @@ spec:
value: "true"
- name: DD_KUBELET_CORE_CHECK_ENABLED
value: "true"
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
value: /var/lib/kubelet/pod-resources/kubelet.sock
image: gcr.io/datadoghq/agent:7.63.2
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -878,6 +880,9 @@ spec:
mountPropagation: None
name: runtimesocketdir
readOnly: true
- mountPath: /var/lib/kubelet/pod-resources
name: pod-resources-socket
readOnly: false
- mountPath: /var/run/datadog
name: dsdsocket
readOnly: false
Expand Down Expand Up @@ -1076,6 +1081,9 @@ spec:
name: tmpdir
- emptyDir: {}
name: s6-run
- hostPath:
path: /var/lib/kubelet/pod-resources
name: pod-resources-socket
- hostPath:
path: /proc
name: procdir
Expand Down
8 changes: 8 additions & 0 deletions test/datadog/baseline/other_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,8 @@ spec:
value: "true"
- name: DD_KUBELET_CORE_CHECK_ENABLED
value: "true"
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
value: /var/lib/kubelet/pod-resources/kubelet.sock
image: gcr.io/datadoghq/agent:7.63.2
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -945,6 +947,9 @@ spec:
mountPropagation: None
name: runtimesocketdir
readOnly: true
- mountPath: /var/lib/kubelet/pod-resources
name: pod-resources-socket
readOnly: false
- mountPath: /var/run/datadog
name: dsdsocket
readOnly: false
Expand Down Expand Up @@ -1143,6 +1148,9 @@ spec:
name: tmpdir
- emptyDir: {}
name: s6-run
- hostPath:
path: /var/lib/kubelet/pod-resources
name: pod-resources-socket
- hostPath:
path: /proc
name: procdir
Expand Down
Loading