Skip to content

Commit

Permalink
Add emptyDir and volumeMount for Agent's logs for Windows containers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonDavenport authored Jul 18, 2023
1 parent 76382d3 commit 15298a0
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 16 deletions.
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.33.2

* Add emptyDir and volumeMounts for Agent log files in Windows containers to fix log file access

# 3.33.0

* Default `Agent` and `Cluster-Agent` to `7.46.0` version.
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 3.33.1
version: 3.33.2
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.33.1](https://img.shields.io/badge/Version-3.33.1-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.33.2](https://img.shields.io/badge/Version-3.33.2-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
6 changes: 3 additions & 3 deletions charts/datadog/templates/_container-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@
{{- include "additional-env-entries" .Values.agents.containers.agent.env | indent 4 }}
{{- include "additional-env-dict-entries" .Values.agents.containers.agent.envDict | indent 4 }}
volumeMounts:
- name: logdatadog
mountPath: {{ template "datadog.logDirectoryPath" . }}
readOnly: false # Need RW to write logs
{{- if eq .Values.targetSystem "linux" }}
- name: installinfo
subPath: install_info
mountPath: /etc/datadog-agent/install_info
readOnly: true
- name: logdatadog
mountPath: /var/log/datadog
readOnly: false # Need RW to write logs
- name: tmpdir
mountPath: /tmp
readOnly: false # Need RW to write to /tmp directory
Expand Down
6 changes: 3 additions & 3 deletions charts/datadog/templates/_container-process-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
- name: config
mountPath: {{ template "datadog.confPath" . }}
readOnly: true
- name: logdatadog
mountPath: {{ template "datadog.logDirectoryPath" . }}
readOnly: false # Need RW to write logs
{{- if eq .Values.targetSystem "linux" }}
{{- if (not .Values.providers.gke.autopilot) }}
- name: auth-token
Expand All @@ -67,9 +70,6 @@
mountPath: {{ (dir .Values.datadog.dogstatsd.socketPath) }}
readOnly: false # Need RW for UDS DSD socket
{{- end }}
- name: logdatadog
mountPath: /var/log/datadog
readOnly: false # Need RW to write logs
- name: tmpdir
mountPath: /tmp
readOnly: false # Need RW to write to tmp directory
Expand Down
6 changes: 3 additions & 3 deletions charts/datadog/templates/_container-security-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
- name: config
mountPath: {{ template "datadog.confPath" . }}
readOnly: true
- name: logdatadog
mountPath: {{ template "datadog.logDirectoryPath" . }}
readOnly: false # Need RW to write logs
{{- if (not .Values.providers.gke.autopilot) }}
- name: auth-token
mountPath: {{ template "datadog.confPath" . }}/auth
Expand All @@ -68,9 +71,6 @@
readOnly: false # Need RW for UDS DSD socket
{{- end }}
{{- if eq .Values.targetSystem "linux" }}
- name: logdatadog
mountPath: /var/log/datadog
readOnly: false # Need RW to write logs
- name: tmpdir
mountPath: /tmp
readOnly: false # Need RW to write to tmp directory
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 @@ -34,7 +34,7 @@
mountPath: {{ template "datadog.confPath" . }}/auth
readOnly: true
- name: logdatadog
mountPath: /var/log/datadog
mountPath: {{ template "datadog.logDirectoryPath" . }}
readOnly: false # Need RW to write logs
- name: tmpdir
mountPath: /tmp
Expand Down
6 changes: 3 additions & 3 deletions charts/datadog/templates/_container-trace-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
- name: config
mountPath: {{ template "datadog.confPath" . }}
readOnly: true
- name: logdatadog
mountPath: {{ template "datadog.logDirectoryPath" . }}
readOnly: false # Need RW to write logs
{{- if (not .Values.providers.gke.autopilot) }}
- name: auth-token
mountPath: {{ template "datadog.confPath" . }}/auth
Expand All @@ -78,9 +81,6 @@
mountPropagation: {{ .Values.datadog.hostVolumeMountPropagation }}
readOnly: true
{{- end }}
- name: logdatadog
mountPath: /var/log/datadog
readOnly: false # Need RW to write logs
- name: tmpdir
mountPath: /tmp
readOnly: false # Need RW for tmp directory
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/templates/_containers-init-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- for script in $(find /etc/cont-init.d/ -type f -name '*.sh' | sort) ; do bash $script ; done
volumeMounts:
- name: logdatadog
mountPath: /var/log/datadog
mountPath: {{ template "datadog.logDirectoryPath" . }}
readOnly: false # Need RW to write logs
- name: config
mountPath: /etc/datadog-agent
Expand Down
2 changes: 2 additions & 0 deletions charts/datadog/templates/_daemonset-volumes-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@
{{- end }}
{{- end }}
{{- end -}}
- name: logdatadog
emptyDir: {}
12 changes: 12 additions & 0 deletions charts/datadog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@ Return the container runtime socket
{{- end -}}
{{- end -}}

{{/*
Return agent log directory path
*/}}
{{- define "datadog.logDirectoryPath" -}}
{{- if eq .Values.targetSystem "linux" -}}
/var/log/datadog
{{- end -}}
{{- if eq .Values.targetSystem "windows" -}}
C:/ProgramData/Datadog/logs
{{- end -}}
{{- end -}}

{{/*
Return agent config path
*/}}
Expand Down

0 comments on commit 15298a0

Please sign in to comment.