Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/datalog] Do not enable the cri check when running on a docker setup #21476

Merged
merged 1 commit into from
Mar 17, 2020
Merged
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
6 changes: 5 additions & 1 deletion stable/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 2.0

## 2.0.10

* Do not enable the `cri` check when running on a `docker` setup.

## 2.0.7

* Pass expected `DD_DOGSTATSD_PORT` to datadog-agent rather than invalid `DD_DOGSTATD_PORT`
Expand All @@ -22,7 +26,7 @@
## 2.0.3

* Fix templating error when `agents.useConfigMap` is set to true.
* Add DD_APM_ENABLED environment variable to trace agent container.
* Add DD\_APM\_ENABLED environment variable to trace agent container.


## 2.0.2
Expand Down
2 changes: 1 addition & 1 deletion stable/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 2.0.9
version: 2.0.10
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
3 changes: 2 additions & 1 deletion stable/datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ helm install --name <RELEASE_NAME> \
| `datadog.processAgent.processCollection` | Enable live process collection. Possible values: `true` enable process collection, `false` disable process collection | `false` |
| `datadog.checksd` | Additional custom checks as python code | `nil` |
| `datadog.confd` | Additional check configurations (static and Autodiscovery) | `nil` |
| `datadog.criSocketPath` | Path to the container runtime socket (default is Docker runtime) | `/var/run/docker.sock` |
| `datadog.dockerSocketPath` | Path to the docker socket | `/var/run/docker.sock` |
| `datadog.criSocketPath` | Path to the container runtime socket (default is Docker runtime) | `nil` |
| `datadog.tags` | Set host tags | `nil` |
| `datadog.useCriSocketVolume` | Enable mounting the container runtime socket in Agent containers | `True` |
| `datadog.dogstatsd.originDetection` | Enable origin detection for container tagging | `False` |
Expand Down
13 changes: 13 additions & 0 deletions stable/datadog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ Return the appropriate apiVersion for RBAC APIs.
"rbac.authorization.k8s.io/v1beta1"
{{- end -}}
{{- end -}}

{{/*
Return the container runtime socket
*/}}
{{- define "datadog.dockerOrCriSocketPath" -}}
{{- if .Values.datadog.dockerSocketPath -}}
{{- .Values.dockerSocketPath -}}
{{- else if .Values.datadog.criSocketPath -}}
{{- .Values.datadog.criSocketPath -}}
{{- else -}}
/var/run/docker.sock
{{- end -}}
{{- end -}}
12 changes: 7 additions & 5 deletions stable/datadog/templates/container-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{{- if .Values.datadog.logLevel }}
- name: DD_LOG_LEVEL
value: {{ .Values.agents.containers.agent.logLevel | default .Values.datadog.logLevel | quote }}
{{- end }}
{{- end }}
{{- if .Values.datadog.dogstatsd.port }}
- name: DD_DOGSTATSD_PORT
value: {{ .Values.datadog.dogstatsd.port | quote }}
Expand Down Expand Up @@ -85,6 +85,10 @@
value: {{ (default false (or .Values.datadog.logs.enabled .Values.datadog.logsEnabled)) | quote}}
- name: DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL
value: {{ (default false (or .Values.datadog.logs.containerCollectAll .Values.datadog.logsConfigContainerCollectAll)) | quote}}
{{- if .Values.datadog.dockerSocketPath }}
- name: DOCKER_HOST
value: unix://{{ .Values.datadog.dockerSocketPath }}
{{- end }}
{{- if .Values.datadog.criSocketPath }}
- name: DD_CRI_SOCKET_PATH
value: {{ .Values.datadog.criSocketPath }}
Expand Down Expand Up @@ -112,11 +116,9 @@
mountPath: /etc/datadog-agent/datadog.yaml
subPath: datadog.yaml
{{- end }}
{{- if .Values.datadog.criSocketPath }}
- name: runtimesocket
mountPath: {{ .Values.datadog.criSocketPath }}
mountPath: {{ template "datadog.dockerOrCriSocketPath" . }}
readOnly: true
{{- end }}
{{- if .Values.datadog.dogstatsd.useSocketVolume }}
- name: dsdsocket
mountPath: "/var/run/datadog"
Expand All @@ -133,7 +135,7 @@
- name: logpodpath
mountPath: /var/log/pods
readOnly: true
{{- if regexFind "^.*docker.*$" $.Values.datadog.criSocketPath }}
{{- if not .Values.datadog.criSocketPath }}
- name: logdockercontainerpath
mountPath: /var/lib/docker/containers
readOnly: true
Expand Down
4 changes: 1 addition & 3 deletions stable/datadog/templates/container-process-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@
- name: procdir
mountPath: /host/proc
readOnly: true
{{- if .Values.datadog.criSocketPath }}
- name: runtimesocket
mountPath: {{ .Values.datadog.criSocketPath }}
mountPath: {{ template "datadog.dockerOrCriSocketPath" . }}
readOnly: true
{{- end }}
{{- if .Values.datadog.systemProbe.enabled }}
- name: sysprobe-socket-dir
mountPath: /opt/datadog-agent/run
Expand Down
8 changes: 5 additions & 3 deletions stable/datadog/templates/containers-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@
- name: procdir
mountPath: /host/proc
readOnly: true
{{- if .Values.datadog.criSocketPath }}
- name: runtimesocket
mountPath: {{ .Values.datadog.criSocketPath }}
mountPath: {{ template "datadog.dockerOrCriSocketPath" . }}
readOnly: true
{{- end }}
env:
{{- include "containers-common-env" . | nindent 4 }}
{{- if .Values.datadog.env }}
{{ toYaml .Values.datadog.env | nindent 4 }}
{{- end }}
{{- if .Values.datadog.dockerSocketPath }}
- name: DOCKER_HOST
value: unix://{{ .Values.datadog.dockerSocketPath }}
{{- end }}
{{- if .Values.datadog.criSocketPath }}
- name: DD_CRI_SOCKET_PATH
value: {{ .Values.datadog.criSocketPath }}
Expand Down
6 changes: 2 additions & 4 deletions stable/datadog/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ spec:
volumes:
- name: config
emptyDir: {}
{{- if .Values.datadog.criSocketPath }}
- hostPath:
path: {{ .Values.datadog.criSocketPath }}
path: {{ template "datadog.dockerOrCriSocketPath" . }}
name: runtimesocket
{{- end }}
{{- if .Values.datadog.dogstatsd.useSocketVolume }}
- hostPath:
path: "/var/run/datadog/"
Expand Down Expand Up @@ -112,7 +110,7 @@ spec:
- hostPath:
path: /var/log/pods
name: logpodpath
{{- if regexFind "^.*docker.*$" $.Values.datadog.criSocketPath }}
{{- if not .Values.datadog.criSocketPath }}
- hostPath:
path: /var/lib/docker/containers
name: logdockercontainerpath
Expand Down
9 changes: 7 additions & 2 deletions stable/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,16 @@ datadog:
# checksd:
# service.py: |-

## @param criSocketPath - string - required
## @param dockerSocketPath - string - optional
## Path to the docker socket
#
# dockerSocketPath: /var/run/docker.sock

## @param criSocketPath - string - optional
## Path to the container runtime socket (if different from Docker)
## This is supported starting from agent 6.6.0
#
criSocketPath: /var/run/docker.sock
# criSocketPath: /var/run/containerd/containerd.sock


## @param processAgent - object - required
Expand Down