Skip to content

Commit

Permalink
[CONTP-277] Expose k8s resource labels as tags to configure tagger (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gabedos authored Sep 24, 2024
1 parent 222f1ae commit 0f893ff
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
5 changes: 5 additions & 0 deletions charts/datadog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Datadog changelog

## 3.71.2

* Add `datadog.kubernetesResourcesLabelsAsTags` to assign Kubernetes Resources Labels as tags in the tagger
* Add `datadog.kubernetesResourcesAnnotationsAsTags` to assign Kuberenetes Resources Annotations as tags in the tagger

## 3.71.1

* Update `fips.image.tag` to `1.1.5` updating openSSL version to 3.0.15
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 3.71.1
version: 3.71.2
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
4 changes: 3 additions & 1 deletion charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.71.1](https://img.shields.io/badge/Version-3.71.1-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.71.2](https://img.shields.io/badge/Version-3.71.2-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 @@ -750,6 +750,8 @@ helm install <RELEASE_NAME> \
| datadog.kubelet.tlsVerify | string | true | Toggle kubelet TLS verification |
| datadog.kubernetesEvents.collectedEventTypes | list | `[{"kind":"Pod","reasons":["Failed","BackOff","Unhealthy","FailedScheduling","FailedMount","FailedAttachVolume"]},{"kind":"Node","reasons":["TerminatingEvictedPod","NodeNotReady","Rebooted","HostPortConflict"]},{"kind":"CronJob","reasons":["SawCompletedJob"]}]` | Event types to be collected. This requires datadog.kubernetesEvents.unbundleEvents to be set to true. |
| datadog.kubernetesEvents.unbundleEvents | bool | `false` | Allow unbundling kubernetes events, 1:1 mapping between Kubernetes and Datadog events. (Requires Cluster Agent 7.42.0+). |
| datadog.kubernetesResourcesAnnotationsAsTags | object | `{}` | Provide a mapping of Kubernetes Resources Annotations to Datadog Tags |
| datadog.kubernetesResourcesLabelsAsTags | object | `{}` | Provide a mapping of Kubernetes Resources Labels to Datadog Tags |
| datadog.leaderElection | bool | `true` | Enables leader election mechanism for event collection |
| datadog.leaderElectionResource | string | `"configmap"` | Selects the default resource to use for leader election. Can be: * "lease" / "leases". Only supported in agent 7.47+ * "configmap" / "configmaps". "" to automatically detect which one to use. |
| datadog.leaderLeaseDuration | string | `nil` | Set the lease time for leader election in second |
Expand Down
8 changes: 8 additions & 0 deletions charts/datadog/templates/_components-common-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
- name: DD_KUBERNETES_NAMESPACE_ANNOTATIONS_AS_TAGS
value: '{{ toJson .Values.datadog.namespaceAnnotationsAsTags }}'
{{- end }}
{{- if .Values.datadog.kubernetesResourcesLabelsAsTags }}
- name: DD_KUBERNETES_RESOURCES_LABELS_AS_TAGS
value: '{{ toJson .Values.datadog.kubernetesResourcesLabelsAsTags }}'
{{- end}}
{{- if .Values.datadog.kubernetesResourcesAnnotationsAsTags }}
- name: DD_KUBERNETES_RESOURCES_ANNOTATIONS_AS_TAGS
value: '{{ toJson .Values.datadog.kubernetesResourcesAnnotationsAsTags }}'
{{- end}}
- name: KUBERNETES
value: "yes"
{{- if .Values.datadog.site }}
Expand Down
22 changes: 22 additions & 0 deletions charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,28 @@ datadog:
# env: environment
# <KUBERNETES_NAMESPACE_ANNOTATIONS>: <DATADOG_TAG_KEY>

# datadog.kubernetesResourcesLabelsAsTags -- Provide a mapping of Kubernetes Resources Labels to Datadog Tags
kubernetesResourcesLabelsAsTags: {}
# deployments.apps:
# x-team: team-from-label
# pods:
# x-ref: reference
# namespaces:
# kubernetes.io/metadata.name: name-as-tag
# <RESOURCE_TYPE>:
# <KUBERNETES_RESOURCE_LABEL>: <DATADOG_TAG_KEY>

# datadog.kubernetesResourcesAnnotationsAsTags -- Provide a mapping of Kubernetes Resources Annotations to Datadog Tags
kubernetesResourcesAnnotationsAsTags: {}
# deployments.apps:
# x-team: team-from-annotation
# pods:
# x-ann: annotation-reference
# namespaces:
# stale-annotation: annotation-as-tag
# <RESOURCE_TYPE>:
# <KUBERNETES_RESOURCE_ANNOTATION>: <DATADOG_TAG_KEY>

originDetectionUnified:
# datadog.originDetectionUnified.enabled -- Enabled enables unified mechanism for origin detection. Default: false. (Requires Agent 7.54.0+).
enabled: false
Expand Down

0 comments on commit 0f893ff

Please sign in to comment.