[stable/datadog] Propagate custom check definitions to CLC Runners (#23139)

It's already possible to define `checksd` and in the Agent config, but
those options are not propagated to the Clusterchecks Runner. As a
runner is basically an agent, we're just reusing the same configuration.

Signed-off-by: Julio Greff <julio.greff@datadoghq.com>
This commit is contained in:
Julio Greff
2020-07-27 01:52:17 -07:00
committed by GitHub
parent d0cc0818b6
commit 13d9e696aa
3 changed files with 47 additions and 2 deletions
+4
View File
@@ -1,5 +1,9 @@
# Datadog changelog
## 2.3.39
* Propagate `datadog.checksd` to the clusterchecks runner to support custom checks there.
## 2.3.38
* Add support of DD\_CONTAINER\_{INCLUDE,EXCLUDE}\_{METRICS,LOGS}
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 2.3.38
version: 2.3.39
appVersion: "7"
description: Datadog Agent
keywords:
@@ -21,6 +21,10 @@ spec:
labels:
app: {{ template "datadog.fullname" . }}-clusterchecks
name: {{ template "datadog.fullname" . }}-clusterchecks
annotations:
{{- if .Values.datadog.checksd }}
checksum/checksd-config: {{ tpl (toYaml .Values.datadog.checksd) . | sha256sum }}
{{- end }}
spec:
{{- if .Values.clusterChecksRunner.rbac.dedicated }}
serviceAccountName: {{ if .Values.clusterChecksRunner.rbac.create }}{{ template "datadog.fullname" . }}-cluster-checks{{ else }}"{{ .Values.clusterChecksRunner.rbac.serviceAccountName }}"{{ end }}
@@ -33,6 +37,34 @@ spec:
dnsConfig:
{{ toYaml .Values.clusterChecksRunner.dnsConfig | indent 8 }}
{{- end }}
initContainers:
- name: init-volume
image: "{{ .Values.agents.image.repository }}:{{ .Values.agents.image.tag }}"
imagePullPolicy: {{ .Values.agents.image.pullPolicy }}
command: ["bash", "-c"]
args:
- cp -r /etc/datadog-agent /opt
volumeMounts:
- name: config
mountPath: /opt/datadog-agent
resources:
{{ toYaml .Values.agents.containers.initContainers.resources | indent 10 }}
- name: init-config
image: "{{ .Values.agents.image.repository }}:{{ .Values.agents.image.tag }}"
imagePullPolicy: {{ .Values.agents.image.pullPolicy }}
command: ["bash", "-c"]
args:
- for script in $(find /etc/cont-init.d/ -type f -name '*.sh' | sort) ; do bash $script ; done
volumeMounts:
- name: config
mountPath: /etc/datadog-agent
{{- if .Values.datadog.checksd }}
- name: checksd
mountPath: /checks.d
readOnly: true
{{- end }}
resources:
{{ toYaml .Values.agents.containers.initContainers.resources | indent 10 }}
containers:
- name: agent
image: "{{ .Values.clusterChecksRunner.image.repository }}:{{ .Values.clusterChecksRunner.image.tag }}"
@@ -104,15 +136,24 @@ spec:
{{ toYaml .Values.clusterChecksRunner.resources | indent 10 }}
{{- if .Values.clusterChecksRunner.volumeMounts }}
volumeMounts:
- name: config
mountPath: {{ template "datadog.confPath" . }}
{{ toYaml .Values.clusterChecksRunner.volumeMounts | indent 10 }}
{{- end }}
livenessProbe:
{{ toYaml .Values.clusterChecksRunner.livenessProbe | indent 10 }}
readinessProbe:
{{ toYaml .Values.clusterChecksRunner.readinessProbe | indent 10 }}
{{- if .Values.clusterChecksRunner.volumes }}
volumes:
{{- if .Values.clusterChecksRunner.volumes }}
{{ toYaml .Values.clusterChecksRunner.volumes | indent 8 }}
{{- end }}
- name: config
emptyDir: {}
{{- if .Values.datadog.checksd }}
- name: checksd
configMap:
name: {{ template "datadog.fullname" . }}-checksd
{{- end }}
affinity:
{{- if .Values.clusterChecksRunner.affinity }}