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 PodResources mount #1696

Merged
merged 5 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Datadog changelog

## 3.92.0

* Add a mount for the Kubernetes PodResources socket.

## 3.91.0

* Add support for GPU monitoring
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.91.0
version: 3.92.0
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
1 change: 1 addition & 0 deletions charts/datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,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
7 changes: 6 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 @@ -207,6 +207,8 @@
- name: DD_OTELCOLLECTOR_ENABLED
value: "true"
{{- end }}
- name: DD_KUBERNETES_KUBELET_PODRESOURCES_SOCKET
value: {{ printf "%s/kubelet.sock" .Values.datadog.kubelet.podResourcesSocket | quote }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good, just wondering if there's ever a chance the socket will not be called kubelet.sock ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've seen, it seems to be hardcoded in the k8s code.

{{- 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 @@ -355,6 +357,9 @@
- name: kubelet-cert-volume
mountPath: /certs
{{- end }}
- name: pod-resources-socket
mountPath: {{ .Values.datadog.kubelet.podResourcesSocketDir }}
readOnly: false
{{- if .Values.agents.volumeMounts }}
{{ toYaml .Values.agents.volumeMounts | indent 4 }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/datadog/templates/_daemonset-volumes-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@
secretName: datadog-kubelet-cert
name: kubelet-cert-volume
{{- end }}
- name: pod-resources-socket
hostPath:
path: {{ .Values.datadog.kubelet.podResourcesSocketDir }}
{{- if .Values.datadog.gpuMonitoring.enabled }}
- name: gpu-devices
hostPath:
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
Loading