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

Commit

Permalink
[stable/datadog] Propagate custom check definitions to CLC Runners (#…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
juliogreff authored Jul 27, 2020
1 parent d0cc081 commit 13d9e69
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
4 changes: 4 additions & 0 deletions stable/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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}
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.3.38
version: 2.3.39
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
43 changes: 42 additions & 1 deletion stable/datadog/templates/agent-clusterchecks-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}"
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 13d9e69

Please sign in to comment.