From 7103e65f0096891208ef755b315282bb3783ef51 Mon Sep 17 00:00:00 2001 From: Ivan Ilichev Date: Thu, 19 Dec 2019 11:03:57 -0500 Subject: [PATCH] [stable/datadog] Allow providing volumes and mounts in the cluster agent deployment (#19679) * Allow providing volumes and mounts in the cluster agent deployment Signed-off-by: Ivan Ilichev * Document volumes and volumeMounts for cluster agent in README Signed-off-by: Ivan Ilichev * Add a test for the volumes and volumeMounts Signed-off-by: Ivan Ilichev * Bump chart version Signed-off-by: Ivan Ilichev * Fix file ending Signed-off-by: Ivan Ilichev * Rename the ci test and change to use a hostPath volume Signed-off-by: Ivan Ilichev --- stable/datadog/Chart.yaml | 2 +- stable/datadog/README.md | 2 ++ .../cluster-agent-volumes-and-mounts-values.yaml | 12 ++++++++++++ .../templates/cluster-agent-deployment.yaml | 10 +++++++++- stable/datadog/values.yaml | 16 ++++++++++++++++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 stable/datadog/ci/cluster-agent-volumes-and-mounts-values.yaml diff --git a/stable/datadog/Chart.yaml b/stable/datadog/Chart.yaml index df639d0bfd..f12bb62931 100644 --- a/stable/datadog/Chart.yaml +++ b/stable/datadog/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: datadog -version: 1.38.16 +version: 1.38.17 appVersion: "6" description: DataDog Agent keywords: diff --git a/stable/datadog/README.md b/stable/datadog/README.md index 0c87fca4df..5c3e2a40a3 100644 --- a/stable/datadog/README.md +++ b/stable/datadog/README.md @@ -359,6 +359,8 @@ helm install --name \ | `clusterAgent.readinessProbe` | Overrides the default readiness probe | http port 443 if external metrics enabled | | `clusterAgent.strategy` | Which update strategy to deploy the cluster-agent | RollingUpdate with 0 maxUnavailable, 1 maxSurge | | `clusterAgent.useHostNetwork` | If true, use the host's network | `nil` | +| `clusterAgent.volumes` | Additional volumes for the cluster-agent deployment | `nil` | +| `clusterAgent.volumeMounts` | Additional volumeMounts for the cluster-agent deployment | `nil` | | `clusterchecksDeployment.enabled` | Enable Datadog agent deployment dedicated for running Cluster Checks. It allows having different resources (Request/Limit) for Cluster Checks agent pods. | `false` | | `clusterchecksDeployment.env` | Additional Datadog environment variables for Cluster Checks Deployment | `nil` | | `clusterchecksDeployment.resources.requests.cpu` | CPU resource requests | `200m` | diff --git a/stable/datadog/ci/cluster-agent-volumes-and-mounts-values.yaml b/stable/datadog/ci/cluster-agent-volumes-and-mounts-values.yaml new file mode 100644 index 0000000000..808ec772a7 --- /dev/null +++ b/stable/datadog/ci/cluster-agent-volumes-and-mounts-values.yaml @@ -0,0 +1,12 @@ +clusterAgent: + enabled: true + + volumes: + - name: tmp + hostPath: + path: /tmp + + volumeMounts: + - name: tmp + mountPath: /etc/tmp + readOnly: true diff --git a/stable/datadog/templates/cluster-agent-deployment.yaml b/stable/datadog/templates/cluster-agent-deployment.yaml index 59ad454819..77443b6a1c 100644 --- a/stable/datadog/templates/cluster-agent-deployment.yaml +++ b/stable/datadog/templates/cluster-agent-deployment.yaml @@ -164,15 +164,23 @@ spec: path: /healthz scheme: HTTPS {{- end }} -{{- if .Values.clusterAgent.confd }} volumeMounts: +{{- if .Values.clusterAgent.confd }} - name: confd mountPath: /conf.d readOnly: true +{{- end }} +{{- if .Values.clusterAgent.volumeMounts }} +{{ toYaml .Values.clusterAgent.volumeMounts | indent 10 }} +{{- end }} volumes: +{{- if .Values.clusterAgent.confd }} - name: confd configMap: name: {{ template "datadog.fullname" . }}-cluster-agent-confd +{{- end }} +{{- if .Values.clusterAgent.volumes }} +{{ toYaml .Values.clusterAgent.volumes | indent 10 }} {{- end }} {{- if .Values.clusterAgent.tolerations }} tolerations: diff --git a/stable/datadog/values.yaml b/stable/datadog/values.yaml index 3db315e1c0..19a85c3487 100644 --- a/stable/datadog/values.yaml +++ b/stable/datadog/values.yaml @@ -467,6 +467,22 @@ clusterAgent: # # useHostNetwork: true + ## @param volumes - list of objects - optional + ## Specify additional volumes to mount in the cluster-agent container + # + # volumes: + # - hostPath: + # path: + # name: + + ## @param volumeMounts - list of objects - optional + ## Specify additional volumes to mount in the cluster-agent container + # + # volumeMounts: + # - name: + # mountPath: + # readOnly: true + rbac: ## @param created - boolean - required