Skip to content

Commit

Permalink
Add PodResources socket mount
Browse files Browse the repository at this point in the history
  • Loading branch information
gjulianm committed Feb 10, 2025
1 parent 6885b61 commit 45c5f7d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
6 changes: 5 additions & 1 deletion charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Datadog changelog

## 3.91.0

* Add a mount for the Kubernetes PodResources socket.

## 3.90.2

* Adds env vars `DD_AGENT_IPC_PORT` and `DD_AGENT_IPC_CONFIG_REFRESH_INTERVAL` when Otel Agent is enabled and adds flag `--sync-delay=30s` to otel agent.
Expand Down Expand Up @@ -42,7 +46,7 @@

## 3.87.0

* Launch `otel-agent` with the `--core-config` switch pointing to the main agent configuration. Note that this affects the OTel Agent beta images, early beta image releases with version tag `<7.59.0-v.1.2.0` will experience issues and should remain on older helm chart versions for their deployments. For regular users not deploying the `otel-agent` beta images, this should be a NOOP.
* Launch `otel-agent` with the `--core-config` switch pointing to the main agent configuration. Note that this affects the OTel Agent beta images, early beta image releases with version tag `<7.59.0-v.1.2.0` will experience issues and should remain on older helm chart versions for their deployments. For regular users not deploying the `otel-agent` beta images, this should be a NOOP.

## 3.86.0

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.90.2
version: 3.91.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 @@ -772,6 +772,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 }}
{{- 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,4 +219,7 @@
secretName: datadog-kubelet-cert
name: kubelet-cert-volume
{{- end }}
- name: pod-resources-socket
hostPath:
path: {{ .Values.datadog.kubelet.podResourcesSocketDir }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,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

0 comments on commit 45c5f7d

Please sign in to comment.