Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.134.0

* Add HPA support for ClusterChecks runners via `clusterChecksRunner.autoscaling`.

## 3.133.0

* Revert changes in 3.131.4 because the configuration is going to be deprecated.
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.133.0
version: 3.134.0
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
9 changes: 8 additions & 1 deletion charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.133.0](https://img.shields.io/badge/Version-3.133.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.134.0](https://img.shields.io/badge/Version-3.134.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 @@ -665,6 +665,13 @@ helm install <RELEASE_NAME> \
| clusterAgent.volumes | list | `[]` | Specify additional volumes to mount in the cluster-agent container |
| clusterChecksRunner.additionalLabels | object | `{}` | Adds labels to the cluster checks runner deployment and pods |
| clusterChecksRunner.affinity | object | `{}` | Allow the ClusterChecks Deployment to schedule using affinity rules. |
| clusterChecksRunner.autoscaling | object | `{"behavior":{},"enabled":false,"maxReplicas":5,"minReplicas":2,"targetCPUUtilizationPercentage":80,"targetMemoryUtilizationPercentage":80}` | Horizontal Pod Autoscaler configuration for Cluster Checks Runner |
| clusterChecksRunner.autoscaling.behavior | object | `{}` | HPA scaling behavior configuration |
| clusterChecksRunner.autoscaling.enabled | bool | `false` | Enable autoscaling for Cluster Checks Runner deployment |
| clusterChecksRunner.autoscaling.maxReplicas | int | `5` | Maximum number of replicas |
| clusterChecksRunner.autoscaling.minReplicas | int | `2` | Minimum number of replicas |
| clusterChecksRunner.autoscaling.targetCPUUtilizationPercentage | int | `80` | Target CPU utilization percentage |
| clusterChecksRunner.autoscaling.targetMemoryUtilizationPercentage | int | `80` | Target memory utilization percentage (optional) |
| clusterChecksRunner.containers.agent.securityContext | object | `{}` | Specify securityContext on the agent container |
| clusterChecksRunner.containers.initContainers.securityContext | object | `{}` | Specify securityContext on the init containers |
| clusterChecksRunner.createPodDisruptionBudget | bool | `false` | Create the pod disruption budget to apply to the cluster checks agents |
Expand Down
11 changes: 11 additions & 0 deletions charts/datadog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1267,3 +1267,14 @@ false
true
{{- end -}}
{{- end -}}

{{/*
Return the appropriate apiVersion for HorizontalPodAutoscaler APIs.
*/}}
{{- define "autoscaling.horizontalpodautoscaler.apiVersion" -}}
{{- if or (.Capabilities.APIVersions.Has "autoscaling/v2/HorizontalPodAutoscaler") (semverCompare ">=1.23" .Capabilities.KubeVersion.Version) -}}
"autoscaling/v2"
{{- else -}}
"autoscaling/v2beta2"
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ metadata:
annotations: {{ toYaml .Values.clusterChecksRunner.deploymentAnnotations | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.clusterChecksRunner.autoscaling.enabled }}
replicas: {{ .Values.clusterChecksRunner.replicas }}
{{- end }}
revisionHistoryLimit: {{ .Values.clusterChecksRunner.revisionHistoryLimit }}
strategy:
{{ toYaml .Values.clusterChecksRunner.strategy | indent 4 }}
Expand Down
37 changes: 37 additions & 0 deletions charts/datadog/templates/agent-clusterchecks-hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- if and (eq (include "should-deploy-cluster-agent" .) "true") (eq (include "should-enable-cluster-check-workers" .) "true") .Values.clusterChecksRunner.autoscaling.enabled -}}
apiVersion: {{ template "autoscaling.horizontalpodautoscaler.apiVersion" . }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "datadog.fullname" . }}-clusterchecks
namespace: {{ .Release.Namespace }}
labels:
{{ include "datadog.labels" . | indent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "datadog.fullname" . }}-clusterchecks
minReplicas: {{ .Values.clusterChecksRunner.autoscaling.minReplicas }}
maxReplicas: {{ .Values.clusterChecksRunner.autoscaling.maxReplicas }}
metrics:
{{- if .Values.clusterChecksRunner.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.clusterChecksRunner.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- if .Values.clusterChecksRunner.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.clusterChecksRunner.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.clusterChecksRunner.autoscaling.behavior }}
behavior:
{{ toYaml .Values.clusterChecksRunner.autoscaling.behavior | indent 4 }}
{{- end }}
{{- end }}
34 changes: 33 additions & 1 deletion charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2428,7 +2428,8 @@ clusterChecksRunner:
# clusterChecksRunner.replicas -- Number of Cluster Checks Runner instances

## If you want to deploy the clusterChecks agent in HA, keep at least clusterChecksRunner.replicas set to 2.
## And increase the clusterChecksRunner.replicas according to the number of Cluster Checks.
## And increase the clusterChecksRunner.replicas according to the number of Cluster Checks or
## use clusterChecksRunner.autoscaling to enable HPA.
replicas: 2

# clusterChecksRunner.revisionHistoryLimit -- The number of old ReplicaSets to keep in this Deployment.
Expand All @@ -2443,6 +2444,37 @@ clusterChecksRunner:
# cpu: 200m
# memory: 500Mi

# clusterChecksRunner.autoscaling -- Horizontal Pod Autoscaler configuration for Cluster Checks Runner
autoscaling:
# clusterChecksRunner.autoscaling.enabled -- Enable autoscaling for Cluster Checks Runner deployment
enabled: false
# clusterChecksRunner.autoscaling.minReplicas -- Minimum number of replicas
minReplicas: 2
# clusterChecksRunner.autoscaling.maxReplicas -- Maximum number of replicas
maxReplicas: 5
# clusterChecksRunner.autoscaling.targetCPUUtilizationPercentage -- Target CPU utilization percentage
targetCPUUtilizationPercentage: 80
# clusterChecksRunner.autoscaling.targetMemoryUtilizationPercentage -- Target memory utilization percentage (optional)
targetMemoryUtilizationPercentage: 80
# clusterChecksRunner.autoscaling.behavior -- HPA scaling behavior configuration
behavior: {}
# scaleDown:
# stabilizationWindowSeconds: 300
# policies:
# - type: Percent
# value: 100
# periodSeconds: 15
# scaleUp:
# stabilizationWindowSeconds: 0
# policies:
# - type: Percent
# value: 100
# periodSeconds: 15
# - type: Pods
# value: 4
# periodSeconds: 15
# selectPolicy: Max

# clusterChecksRunner.affinity -- Allow the ClusterChecks Deployment to schedule using affinity rules.

## By default, ClusterChecks Deployment Pods are preferred to run on different Nodes.
Expand Down