From 685f43751e831b3da155f2c032f15d0daaf8eb8a Mon Sep 17 00:00:00 2001 From: Martin Gaida Date: Tue, 8 Oct 2019 13:19:49 -0700 Subject: [PATCH] [stable/datadog] Allow custom agent configuration (#15861) * datadog agent: allow custom configuration Signed-off-by: Martin Gaida Signed-off-by: Martin Gaida * datadog agent: configuration documentation Signed-off-by: Martin Gaida Signed-off-by: Martin Gaida * stable/datadog: bump version again Signed-off-by: Martin Gaida * stable/datadog: bump version Signed-off-by: Martin Gaida --- stable/datadog/Chart.yaml | 2 +- stable/datadog/README.md | 2 ++ stable/datadog/templates/daemonset.yaml | 3 +++ .../templates/datadog-yaml-configmap.yaml | 7 ++++++ stable/datadog/values.yaml | 24 +++++++++++++++++++ 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/stable/datadog/Chart.yaml b/stable/datadog/Chart.yaml index bd04589de5..4590b786b2 100755 --- a/stable/datadog/Chart.yaml +++ b/stable/datadog/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: datadog -version: 1.38.0 +version: 1.38.1 appVersion: 6.14.0 description: DataDog Agent keywords: diff --git a/stable/datadog/README.md b/stable/datadog/README.md index 37090fe8f3..8f6dafc6c8 100644 --- a/stable/datadog/README.md +++ b/stable/datadog/README.md @@ -320,6 +320,8 @@ helm install --name \ | `daemonset.containers.systemProbe.resources.limits.memory` | Memory resource limits for the system-probe container | `200Mi` | | `daemonset.containers.systemProbe.resources.requests.memory` | Memory resource requests for the system-probe container | `200Mi` | | `daemonset.priorityClassName` | Which Priority Class to associate with the daemonset | `nil` | +| `daemonset.useConfigMap` | Configures a configmap to provide the agent configuration | `false` | +| `daemonset.customAgentConfig` | Specify custom contents for the datadog agent config (datadog.yaml). | `{}` | | `daemonset.updateStrategy` | Which update strategy to deploy the daemonset | RollingUpdate with 10% maxUnavailable | | `datadog.leaderElection` | Enable the leader Election feature | `false` | | `datadog.leaderLeaseDuration` | The duration for which a leader stays elected. | 60 sec, 15 if Cluster Checks enabled | diff --git a/stable/datadog/templates/daemonset.yaml b/stable/datadog/templates/daemonset.yaml index 5ca41c7e12..302c3b48f6 100644 --- a/stable/datadog/templates/daemonset.yaml +++ b/stable/datadog/templates/daemonset.yaml @@ -39,6 +39,9 @@ spec: checksum/autoconf-config: {{ tpl (toYaml .Values.datadog.autoconf) . | sha256sum }} checksum/confd-config: {{ tpl (toYaml .Values.datadog.confd) . | sha256sum }} checksum/checksd-config: {{ tpl (toYaml .Values.datadog.checksd) . | sha256sum }} + {{- if .Values.daemonset.customAgentConfig }} + checksum/agent-config: {{ tpl (toYaml .Values.daemonset.customAgentConfig) . | sha256sum }} + {{- end }} {{- if and .Values.systemProbe.enabled .Values.daemonset.useDedicatedContainers }} container.apparmor.security.beta.kubernetes.io/system-probe: {{ .Values.systemProbe.apparmor }} container.seccomp.security.alpha.kubernetes.io/system-probe: localhost/system-probe diff --git a/stable/datadog/templates/datadog-yaml-configmap.yaml b/stable/datadog/templates/datadog-yaml-configmap.yaml index 66e3700100..637b38b1af 100644 --- a/stable/datadog/templates/datadog-yaml-configmap.yaml +++ b/stable/datadog/templates/datadog-yaml-configmap.yaml @@ -14,8 +14,14 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/version: {{ .Chart.AppVersion }} annotations: + {{- if .Values.daemonset.customAgentConfig }} + checksum/agent-config: {{ tpl (toYaml .Values.daemonset.customAgentConfig) . | sha256sum }} + {{- end }} data: datadog.yaml: | + {{- if .Values.daemonset.customAgentConfig }} +{{ tpl (toYaml .Values.daemonset.customAgentConfig) . | indent 4 }} + {{- else }} ## Provides autodetected defaults, for kubernetes environments, ## please see datadog.yaml.example for all supported options @@ -33,4 +39,5 @@ data: # Use java cgroup memory awareness jmx_use_cgroup_memory_limit: true + {{- end }} {{- end }} diff --git a/stable/datadog/values.yaml b/stable/datadog/values.yaml index f246f7d498..195be3b988 100644 --- a/stable/datadog/values.yaml +++ b/stable/datadog/values.yaml @@ -664,6 +664,30 @@ daemonset: # # useConfigMap: false + ## @param customAgentConfig - object - optional + ## Specify custom contents for the datadog agent config (datadog.yaml). + ## ref: https://docs.datadoghq.com/agent/guide/agent-configuration-files/?tab=agentv6 + ## ref: https://github.com/DataDog/datadog-agent/blob/master/pkg/config/config_template.yaml + # + # customAgentConfig: + # # Autodiscovery for Kubernetes + # listeners: + # - name: kubelet + # config_providers: + # - name: kubelet + # polling: true + # # needed to support legacy docker label config templates + # - name: docker + # polling: true + # + # # Enable APM by setting the DD_APM_ENABLED envvar to true, or override this configuration + # apm_config: + # enabled: false + # apm_non_local_traffic: true + # + # # Use java cgroup memory awareness + # jmx_use_cgroup_memory_limit: true + deployment: ## @param enabled - boolean - required ## Apart from DaemonSet, deploy Datadog agent pods and related service for