Skip to content

Commit

Permalink
Add apiserver additionalconfig for cluster agent (#1655)
Browse files Browse the repository at this point in the history
* add clusterAgent.apiserverCheck.additionalConfigs

* fix values.yaml

* fix values.yaml

* add clusterAgent.kubernetesApiserverCheck.disableUseComponentStatus instead of additionalConfig

* update readme

* update readme and blank default value

* Update charts/datadog/values.yaml

Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com>

* Update charts/datadog/templates/_kubernetes_apiserver_config.yaml

Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com>

* Update charts/datadog/values.yaml

Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com>

* update helper tpl

* update helper tpl

* update deployment

* Update charts/datadog/values.yaml

Co-authored-by: Cedric Lamoriniere <cedric.lamoriniere@datadoghq.com>

* Update charts/datadog/templates/_helpers.tpl

Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com>

* Update charts/datadog/templates/_kubernetes_apiserver_config.yaml

Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com>

* Update charts/datadog/templates/cluster-agent-deployment.yaml

Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com>

* update readme

* Update charts/datadog/values.yaml

Co-authored-by: Cedric Lamoriniere <cedric.lamoriniere@datadoghq.com>

* update readme and update version

* Remove newline

Mistakenly added newline when merging main

---------

Co-authored-by: khewonc <39867936+khewonc@users.noreply.github.com>
Co-authored-by: Cedric Lamoriniere <cedric.lamoriniere@datadoghq.com>
  • Loading branch information
3 people authored Jan 28, 2025
1 parent 5314de1 commit d4ac802
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 6 deletions.
4 changes: 4 additions & 0 deletions charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Datadog changelog

## 3.89.0

* Add `clusterAgent.kubernetesApiserverCheck.disableUseComponentStatus` to disable `use_component_status` option for kubernetes_apiserver check.

## 3.88.3

* Mount /var/lib/containers to generate SBOMs for CRI-O.
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v1
name: datadog
version: 3.88.3
version: 3.89.0
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
3 changes: 2 additions & 1 deletion charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.88.3](https://img.shields.io/badge/Version-3.88.3-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.89.0](https://img.shields.io/badge/Version-3.89.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)

[Datadog](https://www.datadoghq.com/) is a hosted infrastructure monitoring platform. This chart adds the Datadog Agent to all nodes in your cluster via a DaemonSet. It also optionally depends on the [kube-state-metrics chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics). For more information about monitoring Kubernetes with Datadog, please refer to the [Datadog documentation website](https://docs.datadoghq.com/agent/basic_agent_usage/kubernetes/).

Expand Down Expand Up @@ -608,6 +608,7 @@ helm install <RELEASE_NAME> \
| clusterAgent.image.pullSecrets | list | `[]` | Cluster Agent repository pullSecret (ex: specify docker registry credentials) |
| clusterAgent.image.repository | string | `nil` | Override default registry + image.name for Cluster Agent |
| clusterAgent.image.tag | string | `"7.61.0"` | Cluster Agent image tag to use |
| clusterAgent.kubernetesApiserverCheck.disableUseComponentStatus | bool | `false` | Set this to true to disable use_component_status for the kube_apiserver integration. |
| clusterAgent.livenessProbe | object | Every 15s / 6 KO / 1 OK | Override default Cluster Agent liveness probe settings |
| clusterAgent.metricsProvider.aggregator | string | `"avg"` | Define the aggregator the cluster agent will use to process the metrics. The options are (avg, min, max, sum) |
| clusterAgent.metricsProvider.createReaderRbac | bool | `true` | Create `external-metrics-reader` RBAC automatically (to allow HPA to read data from Cluster Agent) |
Expand Down
13 changes: 12 additions & 1 deletion charts/datadog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,18 @@ Return Kubelet volumeMount
Return true if the Cluster Agent needs a confd configmap
*/}}
{{- define "need-cluster-agent-confd" -}}
{{- if (or (.Values.clusterAgent.confd) (.Values.datadog.kubeStateMetricsCore.enabled) (.Values.clusterAgent.advancedConfd) (.Values.datadog.helmCheck.enabled)) -}}
{{- if (or (.Values.clusterAgent.confd) (.Values.datadog.kubeStateMetricsCore.enabled) (.Values.clusterAgent.advancedConfd) (.Values.datadog.helmCheck.enabled) (.Values.datadog.collectEvents) (.Values.clusterAgent.kubernetesApiserverCheck.disableUseComponentStatus)) -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}

{{/*
Return true if kubernetes_apiserver check should be configured
*/}}
{{- define "need-kubernetes-apiserver-check-config" -}}
{{- if or (.Values.datadog.collectEvents) (.Values.clusterAgent.kubernetesApiserverCheck.disableUseComponentStatus) -}}
true
{{- else -}}
false
Expand Down
10 changes: 8 additions & 2 deletions charts/datadog/templates/_kubernetes_apiserver_config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{{- define "kubernetes_apiserver-config" -}}
{{- if .Values.datadog.collectEvents -}}
{{- if eq (include "need-kubernetes-apiserver-check-config" .) "true" }}
kubernetes_apiserver.yaml: |-
init_config:
instances:
- filtering_enabled: {{ .Values.datadog.kubernetesEvents.filteringEnabled }}
-

This comment has been minimized.

Copy link
@buddyledungarees

buddyledungarees Feb 5, 2025

This indentation is wrong, leads to this output:

+
+   kubernetes_apiserver.yaml: |-
+     init_config:
+     instances:
+       -
+         filtering_enabled: false
+         unbundle_events: false
{{- if .Values.datadog.collectEvents }}
filtering_enabled: {{ .Values.datadog.kubernetesEvents.filteringEnabled }}
unbundle_events: {{ .Values.datadog.kubernetesEvents.unbundleEvents }}
{{- if .Values.datadog.kubernetesEvents.unbundleEvents }}
collected_event_types:
{{ .Values.datadog.kubernetesEvents.collectedEventTypes | toYaml | nindent 8 }}
{{- end -}}
{{- end }}
{{- if .Values.clusterAgent.kubernetesApiserverCheck.disableUseComponentStatus }}
use_component_status: false
{{- end }}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/datadog/templates/cluster-agent-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ spec:
- key: helm.yaml
path: helm.yaml
{{- end }}
{{- if .Values.datadog.collectEvents }}
{{- if eq (include "need-kubernetes-apiserver-check-config" .) "true" }}
- key: kubernetes_apiserver.yaml
path: kubernetes_apiserver.yaml
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,11 @@ clusterAgent:
# username: datadog
# password: <YOUR_CHOSEN_PASSWORD>

## clusterAgent.kubernetesApiserverCheck -- correspond to options for configuring the kube_apiserver integration.
kubernetesApiserverCheck:
# clusterAgent.kubernetesApiserverCheck.disableUseComponentStatus -- Set this to true to disable use_component_status for the kube_apiserver integration.
disableUseComponentStatus: false

# clusterAgent.resources -- Datadog cluster-agent resource requests and limits.
resources: {}
# requests:
Expand Down

0 comments on commit d4ac802

Please sign in to comment.