Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service account additional labels #1628

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
6 changes: 6 additions & 0 deletions charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Datadog changelog

## 3.91.0

* Support adding labels to the Agent service account via `agents.additionalLabels`.
* Support adding labels to the Cluster Agent service account via `clusterAgent.rbac.serviceAccountAdditionalLabels`.
* Support adding labels to the Cluster Checks Runner service account via `clusterChecksRunner.rbac.serviceAccountAdditionalLabels`.

## 3.90.3

* Defaults `registry` to `gcr.io/datadoghq` when setting `datadog.site: us3.datadoghq.com` and deploying on GKE Autopilot (`providers.gke.autopilot: true`).
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.90.3
version: 3.91.0
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
5 changes: 4 additions & 1 deletion charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.90.3](https://img.shields.io/badge/Version-3.90.3-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.91.0](https://img.shields.io/badge/Version-3.91.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 @@ -550,6 +550,7 @@ helm install <RELEASE_NAME> \
| agents.priorityPreemptionPolicyValue | string | `"PreemptLowerPriority"` | Set to "Never" to change the PriorityClass to non-preempting |
| agents.rbac.automountServiceAccountToken | bool | `true` | If true, automatically mount the ServiceAccount's API credentials if agents.rbac.create is true |
| agents.rbac.create | bool | `true` | If true, create & use RBAC resources |
| agents.rbac.serviceAccountAdditionalLabels | object | `{}` | Labels to add to the ServiceAccount if agents.rbac.create is true |
| agents.rbac.serviceAccountAnnotations | object | `{}` | Annotations to add to the ServiceAccount if agents.rbac.create is true |
| agents.rbac.serviceAccountName | string | `"default"` | Specify a preexisting ServiceAccount to use if agents.rbac.create is false |
| agents.revisionHistoryLimit | int | `10` | The number of ControllerRevision to keep in this DaemonSet. |
Expand Down Expand Up @@ -628,6 +629,7 @@ helm install <RELEASE_NAME> \
| clusterAgent.rbac.automountServiceAccountToken | bool | `true` | If true, automatically mount the ServiceAccount's API credentials if clusterAgent.rbac.create is true |
| clusterAgent.rbac.create | bool | `true` | If true, create & use RBAC resources |
| clusterAgent.rbac.flareAdditionalPermissions | bool | `true` | If true, add Secrets and Configmaps get/list permissions to retrieve user Datadog Helm values from Cluster Agent namespace |
| clusterAgent.rbac.serviceAccountAdditionalLabels | object | `{}` | Labels to add to the ServiceAccount if clusterAgent.rbac.create is true |
| clusterAgent.rbac.serviceAccountAnnotations | object | `{}` | Annotations to add to the ServiceAccount if clusterAgent.rbac.create is true |
| clusterAgent.rbac.serviceAccountName | string | `"default"` | Specify a preexisting ServiceAccount to use if clusterAgent.rbac.create is false |
| clusterAgent.readinessProbe | object | Every 15s / 6 KO / 1 OK | Override default Cluster Agent readiness probe settings |
Expand Down Expand Up @@ -673,6 +675,7 @@ helm install <RELEASE_NAME> \
| clusterChecksRunner.rbac.automountServiceAccountToken | bool | `true` | If true, automatically mount the ServiceAccount's API credentials if clusterChecksRunner.rbac.create is true |
| clusterChecksRunner.rbac.create | bool | `true` | If true, create & use RBAC resources |
| clusterChecksRunner.rbac.dedicated | bool | `false` | If true, use a dedicated RBAC resource for the cluster checks agent(s) |
| clusterChecksRunner.rbac.serviceAccountAdditionalLabels | object | `{}` | Labels to add to the ServiceAccount if clusterChecksRunner.rbac.dedicated is true |
| clusterChecksRunner.rbac.serviceAccountAnnotations | object | `{}` | Annotations to add to the ServiceAccount if clusterChecksRunner.rbac.dedicated is true |
| clusterChecksRunner.rbac.serviceAccountName | string | `"default"` | Specify a preexisting ServiceAccount to use if clusterChecksRunner.rbac.create is false |
| clusterChecksRunner.readinessProbe | object | Every 15s / 6 KO / 1 OK | Override default agent readiness probe settings |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
agents:
enabled: true
rbac:
enabled: true
serviceAccountAdditionalLabels:
"app.kubernetes.io/custom-label": custom-value
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
datadog:
apiKey: "00000000000000000000000000000000"
appKey: "0000000000000000000000000000000000000000"
kubeStateMetricsEnabled: false
clusterChecks:
enabled: true

clusterAgent:
enabled: true
rbac:
create: true
serviceAccountAdditionalLabels:
"app.kubernetes.io/custom-label": custom-value

clusterChecksRunner:
enabled: true
replicas: 1
rbac:
dedicated: true
serviceAccountAdditionalLabels:
"app.kubernetes.io/custom-label": custom-value
3 changes: 3 additions & 0 deletions charts/datadog/templates/agent-clusterchecks-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ metadata:
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
{{- if .Values.clusterChecksRunner.rbac.serviceAccountAdditionalLabels -}}
{{ tpl (toYaml .Values.clusterChecksRunner.rbac.serviceAccountAdditionalLabels) . | nindent 4}}
{{- end }}
name: {{ template "datadog.fullname" . }}-cluster-checks
namespace: {{ .Release.Namespace }}
{{- if .Values.clusterChecksRunner.rbac.serviceAccountAnnotations }}
Expand Down
3 changes: 3 additions & 0 deletions charts/datadog/templates/cluster-agent-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ metadata:
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
{{ include "datadog.labels" . | indent 4 }}
{{- if .Values.clusterAgent.rbac.serviceAccountAdditionalLabels -}}
{{ tpl (toYaml .Values.clusterAgent.rbac.serviceAccountAdditionalLabels) . | nindent 4 -}}
{{ end }}
{{- if .Values.clusterAgent.rbac.serviceAccountAnnotations }}
annotations: {{ tpl (toYaml .Values.clusterAgent.rbac.serviceAccountAnnotations) . | nindent 4}}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/datadog/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ metadata:
{{- end }}
labels:
{{ include "datadog.labels" . | indent 4 }}
{{- if .Values.agents.rbac.serviceAccountAdditionalLabels -}}
{{ tpl (toYaml .Values.agents.rbac.serviceAccountAdditionalLabels) . | nindent 4}}
{{- end }}
{{- range $role := .Values.datadog.secretBackend.roles }}
---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
10 changes: 10 additions & 0 deletions charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,9 @@ clusterAgent:
# clusterAgent.rbac.serviceAccountAnnotations -- Annotations to add to the ServiceAccount if clusterAgent.rbac.create is true
serviceAccountAnnotations: {}

# clusterAgent.rbac.serviceAccountAdditionalLabels -- Labels to add to the ServiceAccount if clusterAgent.rbac.create is true
serviceAccountAdditionalLabels: {}

# clusterAgent.rbac.automountServiceAccountToken -- If true, automatically mount the ServiceAccount's API credentials if clusterAgent.rbac.create is true
automountServiceAccountToken: true

Expand Down Expand Up @@ -1596,6 +1599,9 @@ agents:
# agents.rbac.serviceAccountAnnotations -- Annotations to add to the ServiceAccount if agents.rbac.create is true
serviceAccountAnnotations: {}

# agents.rbac.serviceAccountAdditionalLabels -- Labels to add to the ServiceAccount if agents.rbac.create is true
serviceAccountAdditionalLabels: {}

# agents.rbac.automountServiceAccountToken -- If true, automatically mount the ServiceAccount's API credentials if agents.rbac.create is true
automountServiceAccountToken: true

Expand Down Expand Up @@ -2096,6 +2102,10 @@ clusterChecksRunner:
# clusterChecksRunner.rbac.serviceAccountAnnotations -- Annotations to add to the ServiceAccount if clusterChecksRunner.rbac.dedicated is true
serviceAccountAnnotations: {}

# clusterChecksRunner.rbac.serviceAccountAdditionalLabels -- Labels to add to the ServiceAccount if clusterChecksRunner.rbac.dedicated is true
serviceAccountAdditionalLabels: {}


# clusterChecksRunner.rbac.automountServiceAccountToken -- If true, automatically mount the ServiceAccount's API credentials if clusterChecksRunner.rbac.create is true
automountServiceAccountToken: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog-clusterchecks
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.90.2'
helm.sh/chart: 'datadog-3.91.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -36,8 +36,8 @@ spec:

name: datadog-clusterchecks
annotations:
checksum/clusteragent_token: 394df2a714d93c44949d7e7af42bb700e71308f40a965692b4e883443c31a1e1
checksum/install_info: 8259f0118cc24f897cb93f1c9bc5e8758de1ba559ec3ed571df7ad67c9d31a24
checksum/clusteragent_token: e713f4e98c0efbec4db5a940b0121f3f032e91c26effbc1fc02f49a4296b7581
checksum/install_info: d99057d2f27261db48a091cf5b114431385f7e656a0b4575b81b9ade7b02583d
spec:
serviceAccountName: datadog-cluster-checks
automountServiceAccountToken: true
Expand Down
10 changes: 5 additions & 5 deletions test/datadog/baseline/cluster-agent-deployment_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog-cluster-agent
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.90.2'
helm.sh/chart: 'datadog-3.91.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -36,11 +36,11 @@ spec:

name: datadog-cluster-agent
annotations:
checksum/clusteragent_token: e0c4e91dfb160d295654179552a2736fd59d331036ee62125156748843b613b3
checksum/clusteragent-configmap: 63ca8b61b95408ae798632fed914c711a7a3492cadf4caf2d7d3981ca9f091c2
checksum/api_key: 0b1dc9b6f97901330e2dfcb5dd8e06eeab960aa872f18b04e9aec5dd64030c9b
checksum/clusteragent_token: 17eb8c681248609834507d1e5c03d85732b0720c7752c320c9b88a3baf2479d4
checksum/clusteragent-configmap: 04f78cc8c755f4c6debb07948b1bf8318109acb1f32d624857bf409e9e7570c0
checksum/api_key: 657e19756058df21cac9dd8bdb1289cdf8ab0a632155ce5b9cd382881874a62f
checksum/application_key: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
checksum/install_info: 8259f0118cc24f897cb93f1c9bc5e8758de1ba559ec3ed571df7ad67c9d31a24
checksum/install_info: d99057d2f27261db48a091cf5b114431385f7e656a0b4575b81b9ade7b02583d
spec:
serviceAccountName: datadog-cluster-agent
automountServiceAccountToken: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog-cluster-agent
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.90.2'
helm.sh/chart: 'datadog-3.91.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -36,11 +36,11 @@ spec:

name: datadog-cluster-agent
annotations:
checksum/clusteragent_token: d6c63a0df284f4d85997d84e0da07ac7a76e8cf4402aa6355b55cfd96b210f23
checksum/clusteragent-configmap: 63ca8b61b95408ae798632fed914c711a7a3492cadf4caf2d7d3981ca9f091c2
checksum/api_key: 0b1dc9b6f97901330e2dfcb5dd8e06eeab960aa872f18b04e9aec5dd64030c9b
checksum/clusteragent_token: 1711e39876877dfe261390df64bc3cb68847138a773923075a7d0186f6247e3d
checksum/clusteragent-configmap: 04f78cc8c755f4c6debb07948b1bf8318109acb1f32d624857bf409e9e7570c0
checksum/api_key: 657e19756058df21cac9dd8bdb1289cdf8ab0a632155ce5b9cd382881874a62f
checksum/application_key: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
checksum/install_info: 8259f0118cc24f897cb93f1c9bc5e8758de1ba559ec3ed571df7ad67c9d31a24
checksum/install_info: d99057d2f27261db48a091cf5b114431385f7e656a0b4575b81b9ade7b02583d
spec:
serviceAccountName: datadog-cluster-agent
automountServiceAccountToken: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog-cluster-agent
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.90.2'
helm.sh/chart: 'datadog-3.91.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -36,11 +36,11 @@ spec:

name: datadog-cluster-agent
annotations:
checksum/clusteragent_token: d55d3311edfc5f652f0fe73d2131312641abcd9e521e11fbcb9b3b62daed9217
checksum/clusteragent-configmap: 63ca8b61b95408ae798632fed914c711a7a3492cadf4caf2d7d3981ca9f091c2
checksum/api_key: 0b1dc9b6f97901330e2dfcb5dd8e06eeab960aa872f18b04e9aec5dd64030c9b
checksum/clusteragent_token: b75ff153cb9cb8dd1678bc7a68bf86b09d3caf88acc18d4f1a2c3af238298e69
checksum/clusteragent-configmap: 04f78cc8c755f4c6debb07948b1bf8318109acb1f32d624857bf409e9e7570c0
checksum/api_key: 657e19756058df21cac9dd8bdb1289cdf8ab0a632155ce5b9cd382881874a62f
checksum/application_key: 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
checksum/install_info: 8259f0118cc24f897cb93f1c9bc5e8758de1ba559ec3ed571df7ad67c9d31a24
checksum/install_info: d99057d2f27261db48a091cf5b114431385f7e656a0b4575b81b9ade7b02583d
spec:
serviceAccountName: datadog-cluster-agent
automountServiceAccountToken: true
Expand Down
6 changes: 3 additions & 3 deletions test/datadog/baseline/daemonset_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.90.2'
helm.sh/chart: 'datadog-3.91.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand All @@ -30,8 +30,8 @@ spec:

name: datadog
annotations:
checksum/clusteragent_token: a4cd0b2eccf03f28de831e4664477e73354ae56f0dedfcec33e85f0e2b0da008
checksum/install_info: 8259f0118cc24f897cb93f1c9bc5e8758de1ba559ec3ed571df7ad67c9d31a24
checksum/clusteragent_token: cc9e040fbbf6ce5883ce64cf7796d2fde94d15885f9d361040c0d2deedd30ea8
checksum/install_info: d99057d2f27261db48a091cf5b114431385f7e656a0b4575b81b9ade7b02583d
checksum/autoconf-config: 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b
checksum/confd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
checksum/checksd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
Expand Down
6 changes: 3 additions & 3 deletions test/datadog/baseline/gdc_daemonset_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.90.2'
helm.sh/chart: 'datadog-3.91.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand All @@ -30,8 +30,8 @@ spec:
env.datadoghq.com/kind: gke-gdc
name: datadog
annotations:
checksum/clusteragent_token: 7024d7bbb843ff1e8f222957eb1366a7e2e4cade071aeac406df417976aa5d65
checksum/install_info: 8259f0118cc24f897cb93f1c9bc5e8758de1ba559ec3ed571df7ad67c9d31a24
checksum/clusteragent_token: 5b0f17b047d469e0575208ea26c00efa51d5d8a1f9dd43f70dd242f55dd4f685
checksum/install_info: d99057d2f27261db48a091cf5b114431385f7e656a0b4575b81b9ade7b02583d
checksum/autoconf-config: 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b
checksum/confd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
checksum/checksd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
Expand Down
6 changes: 3 additions & 3 deletions test/datadog/baseline/gdc_daemonset_logs_collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: datadog
namespace: datadog-agent
labels:
helm.sh/chart: 'datadog-3.90.2'
helm.sh/chart: 'datadog-3.91.0'
app.kubernetes.io/name: "datadog"
app.kubernetes.io/instance: "datadog"
app.kubernetes.io/managed-by: Helm
Expand All @@ -30,8 +30,8 @@ spec:
env.datadoghq.com/kind: gke-gdc
name: datadog
annotations:
checksum/clusteragent_token: bedf4b98bef468ea34a4e0b4d6d8794d096157170b4f2941744ad406708bc97e
checksum/install_info: 8259f0118cc24f897cb93f1c9bc5e8758de1ba559ec3ed571df7ad67c9d31a24
checksum/clusteragent_token: dee8b4351d82c57ffb1a565aa2265c8701d3690f4ad239681c8107c1894268a7
checksum/install_info: d99057d2f27261db48a091cf5b114431385f7e656a0b4575b81b9ade7b02583d
checksum/autoconf-config: 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b
checksum/confd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
checksum/checksd-config: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
Expand Down
Loading
Loading