Skip to content

Commit

Permalink
feat(ssi): add target based workload selection
Browse files Browse the repository at this point in the history
This commit enables target based workload selection with validation.
  • Loading branch information
betterengineering committed Mar 6, 2025
1 parent 3e389bc commit 77a09cd
Show file tree
Hide file tree
Showing 19 changed files with 676 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.103.0

* Validation has been added for values under `datadog.apm.instrumentation`.
* Target based workload selection for Single Step Instrumentation has been added in preview (requires Cluster Agent 7.64.0+)

## 3.102.0

* Add a mount for the Kubernetes PodResources socket.
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.102.0
version: 3.103.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.102.0](https://img.shields.io/badge/Version-3.102.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.103.0](https://img.shields.io/badge/Version-3.103.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 @@ -703,6 +703,7 @@ helm install <RELEASE_NAME> \
| datadog.apm.instrumentation.language_detection.enabled | bool | `true` | Run language detection to automatically detect languages of user workloads (preview). |
| datadog.apm.instrumentation.libVersions | object | `{}` | Inject specific version of tracing libraries with Single Step Instrumentation (preview). |
| datadog.apm.instrumentation.skipKPITelemetry | bool | `false` | Disable generating Configmap for APM Instrumentation KPIs |
| datadog.apm.instrumentation.targets | list | `[]` | Enable target based workload selection (preview). Requires Cluster Agent 7.64.0+ |
| datadog.apm.port | int | `8126` | Override the trace Agent port |
| datadog.apm.portEnabled | bool | `false` | Enable APM over TCP communication (hostPort 8126 by default) |
| datadog.apm.socketEnabled | bool | `true` | Enable APM over Socket (Unix Socket or windows named pipe) |
Expand Down
4 changes: 4 additions & 0 deletions charts/datadog/templates/cluster-agent-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ spec:
- name: DD_APM_INSTRUMENTATION_LIB_VERSIONS
value: {{ .Values.datadog.apm.instrumentation.libVersions | toJson | quote }}
{{- end }}
{{- if .Values.datadog.apm.instrumentation.targets }}
- name: DD_APM_INSTRUMENTATION_TARGETS
value: {{ .Values.datadog.apm.instrumentation.targets | toJson | quote }}
{{- end }}
{{- if .Values.datadog.apm.instrumentation.injector.imageTag }}
- name: DD_APM_INSTRUMENTATION_INJECTOR_IMAGE_TAG
value: {{ .Values.datadog.apm.instrumentation.injector.imageTag | quote }}
Expand Down
300 changes: 300 additions & 0 deletions charts/datadog/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "Values",
"type": "object",
"properties": {
"datadog": {
"type": "object",
"properties": {
"apm": {
"type": "object",
"properties": {
"instrumentation": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"enabledNamespaces": {
"type": "array",
"items": {
"type": "string"
}
},
"disabledNamespaces": {
"type": "array",
"items": {
"type": "string"
}
},
"libVersions": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"targets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"podSelector": {
"type": "object",
"properties": {
"matchLabels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"matchExpressions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"In",
"NotIn",
"Exists",
"DoesNotExist"
]
},
"values": {
"type": "array",
"items": { "type": "string" },
"minItems": 1
}
},
"required": ["key", "operator"],
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"namespaceSelector": {
"type": "object",
"properties": {
"matchNames": {
"type": "array",
"items": {
"type": "string"
}
},
"matchLabels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"matchExpressions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string",
"enum": [
"In",
"NotIn",
"Exists",
"DoesNotExist"
]
},
"values": {
"type": "array",
"items": { "type": "string" },
"minItems": 1
}
},
"required": ["key", "operator"],
"additionalProperties": false
}
}
},
"anyOf": [
{
"if": {
"properties": {
"matchNames": {
"type": "array",
"minItems": 1
}
}
},
"then": {
"properties": {
"matchLabels": {
"type": "object",
"maxProperties": 0
},
"matchExpressions": {
"type": "array",
"maxItems": 0
}
}
}
},
{
"if": {
"properties": {
"matchLabels": {
"type": "object",
"minProperties": 1
}
}
},
"then": {
"properties": {
"matchNames": {
"type": "array",
"maxItems": 0
}
}
}
},
{
"if": {
"properties": {
"matchExpressions": {
"type": "array",
"minItems": 1
}
}
},
"then": {
"properties": {
"matchNames": {
"type": "array",
"maxItems": 0
}
}
}
}
],
"additionalProperties": false
},
"ddTraceVersions": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"ddTraceConfig": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["name", "value"],
"additionalProperties": false
}
}
},
"required": ["name"],
"additionalProperties": false
}
},
"skipKPITelemetry": {
"type": "boolean"
},
"language_detection": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
},
"additionalProperties": false
},
"injector": {
"type": "object",
"properties": {
"imageTag": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"enabledNamespaces": {
"type": "array",
"minItems": 1
}
}
},
"then": {
"properties": {
"targets": {
"type": "array",
"maxItems": 0
}
}
}
},
{
"if": {
"properties": {
"libVersions": {
"type": "object",
"minProperties": 1
}
}
},
"then": {
"properties": {
"targets": {
"type": "array",
"maxItems": 0
}
}
}
},
{
"if": {
"properties": {
"enabledNamespaces": {
"type": "array",
"minItems": 1
}
}
},
"then": {
"properties": {
"disabledNamespaces": {
"type": "array",
"maxItems": 0
}
}
}
}
]
}
}
}
}
}
}
}
4 changes: 4 additions & 0 deletions charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,10 @@ datadog:
# datadog.apm.instrumentation.libVersions -- Inject specific version of tracing libraries with Single Step Instrumentation (preview).
libVersions: {}

# datadog.apm.instrumentation.targets -- Enable target based workload selection (preview).
# Requires Cluster Agent 7.64.0+
targets: []

# datadog.apm.instrumentation.skipKPITelemetry -- Disable generating Configmap for APM Instrumentation KPIs
skipKPITelemetry: false

Expand Down
Loading

0 comments on commit 77a09cd

Please sign in to comment.