From 7ba8bec233e60fdd7e226bac2f10e0abc52d5c5e Mon Sep 17 00:00:00 2001 From: Doug Winter Date: Thu, 31 Oct 2019 13:47:36 +0000 Subject: [PATCH] [stable/datadog] allow host networking for metrics (#15206) * [stable/datadog] allow host networking for metrics Signed-off-by: Doug Winter * doc update Signed-off-by: Doug Winter * Update stable/datadog/templates/agent-service-metrics.yaml Co-Authored-By: Cedric Lamoriniere Signed-off-by: Doug Winter * Update stable/datadog/values.yaml Co-Authored-By: Cedric Lamoriniere Signed-off-by: Doug Winter * annotations is unused Signed-off-by: Doug Winter * Rework structure of values to match usage Signed-off-by: Andrew Plummer * Bump version Signed-off-by: Andrew Plummer * CR: remove docstring line Signed-off-by: Andrew Plummer --- stable/datadog/Chart.yaml | 2 +- stable/datadog/README.md | 2 ++ stable/datadog/templates/agent-services.yaml | 2 +- .../templates/cluster-agent-deployment.yaml | 4 ++++ stable/datadog/values.yaml | 18 ++++++++++++++++++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/stable/datadog/Chart.yaml b/stable/datadog/Chart.yaml index 4590b786b2..4598db5f4a 100755 --- a/stable/datadog/Chart.yaml +++ b/stable/datadog/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: datadog -version: 1.38.1 +version: 1.38.2 appVersion: 6.14.0 description: DataDog Agent keywords: diff --git a/stable/datadog/README.md b/stable/datadog/README.md index 8f6dafc6c8..00cc82b3e9 100644 --- a/stable/datadog/README.md +++ b/stable/datadog/README.md @@ -343,6 +343,7 @@ helm install --name \ | `clusterAgent.image.pullPolicy` | Image pull policy | `IfNotPresent` | | `clusterAgent.image.pullSecrets` | Image pull secrets | `nil` | | `clusterAgent.metricsProvider.enabled` | Enable Datadog metrics as a source for HPA scaling | `false` | +| `clusterAgent.metricsProvider.service.type` | The type of service to use for the clusterAgent metrics server | `ClusterIP` | | `clusterAgent.clusterChecks.enabled` | Enable Cluster Checks on both the Cluster Agent and the Agent daemonset | `false` | | `clusterAgent.confd` | Additional check configurations (static and Autodiscovery) | `nil` | | `clusterAgent.podAnnotations` | Annotations to add to the Cluster Agent Pod(s) | `nil` | @@ -355,6 +356,7 @@ helm install --name \ | `clusterAgent.livenessProbe` | Overrides the default liveness probe | http port 443 if external metrics enabled | | `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` | | `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/templates/agent-services.yaml b/stable/datadog/templates/agent-services.yaml index 4d79606e08..8abadfc135 100644 --- a/stable/datadog/templates/agent-services.yaml +++ b/stable/datadog/templates/agent-services.yaml @@ -40,7 +40,7 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service | quote }} app.kubernetes.io/version: {{ .Chart.AppVersion }} spec: - type: ClusterIP + type: {{ .Values.clusterAgent.metricsProvider.service.type }} selector: app: {{ template "datadog.fullname" . }}-cluster-agent ports: diff --git a/stable/datadog/templates/cluster-agent-deployment.yaml b/stable/datadog/templates/cluster-agent-deployment.yaml index 84d4424d68..33a54fd11c 100644 --- a/stable/datadog/templates/cluster-agent-deployment.yaml +++ b/stable/datadog/templates/cluster-agent-deployment.yaml @@ -57,6 +57,10 @@ spec: {{- if .Values.clusterAgent.image.pullSecrets }} imagePullSecrets: {{ toYaml .Values.clusterAgent.image.pullSecrets | indent 8 }} + {{- end }} + {{- if .Values.clusterAgent.useHostNetwork }} + hostNetwork: {{ .Values.clusterAgent.useHostNetwork }} + dnsPolicy: ClusterFirstWithHostNet {{- end }} containers: - name: {{ .Values.clusterAgent.containerName }} diff --git a/stable/datadog/values.yaml b/stable/datadog/values.yaml index 195be3b988..f2e4272952 100644 --- a/stable/datadog/values.yaml +++ b/stable/datadog/values.yaml @@ -356,6 +356,14 @@ clusterAgent: metricsProvider: enabled: false + ## Configuration for the service for the cluster-agent metrics server + # + service: + ## @param type - string - optional + ## + # + type: ClusterIP + ## @param clusterChecks - object - required ## Enable the Cluster Checks feature on both the cluster-agents and the daemonset ## ref: https://docs.datadoghq.com/agent/autodiscovery/clusterchecks/ @@ -424,6 +432,16 @@ clusterAgent: # # readinessProbe: + ## @param useHostNetwork - boolean - optional + ## Bind ports on the hostNetwork. Useful for CNI networking where hostPort might + ## not be supported. The ports need to be available on all hosts. It can be + ## used for custom metrics instead of a service endpoint. + ## + ## WARNING: Make sure that hosts using this are properly firewalled otherwise + ## metrics and traces are accepted from any host able to connect to this host. + # + # useHostNetwork: true + rbac: ## @param created - boolean - required