Skip to content

Commit

Permalink
[CWS] Configuration options for enabling CWSInstrumentation in the cl…
Browse files Browse the repository at this point in the history
…uster-agent and from the operator
  • Loading branch information
Gui774ume committed May 13, 2024
1 parent 0a95180 commit ad3834f
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 3 deletions.
4 changes: 4 additions & 0 deletions charts/datadog-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.6.2

* Add configuration to grand to the operator the necessary RBAC for the CWS Instrumentation admission controller feature in the Cluster-Agent to work.

## 1.6.1

* Fix clusterRole when DatadogAgentProfiles are enabled.
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ maintainers:
email: support@datadoghq.com
dependencies:
- name: datadog-crds
version: "=1.5.0"
version: "=1.5.1"
alias: datadogCRDs
repository: https://helm.datadoghq.com
condition: installCRDs
Expand Down
5 changes: 5 additions & 0 deletions charts/datadog-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -730,4 +730,9 @@ rules:
verbs:
- update
{{- end }}
{{- if .Values.addCWSInstrumentationRBAC }}
- apiGroups: [""]
resources: ["pods/exec"]
verbs: ["create"]
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/datadog-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,7 @@ volumeMounts: []
# - name: <VOLUME_NAME>
# mountPath: <CONTAINER_PATH>
# readOnly: true

# addCWSInstrumentationRBAC -- Defines if the operator should be deployed with the RBAC required for the cluster-agent
# CWSInstrumentation feature.
addCWSInstrumentationRBAC: false
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.63.0

* Add `pods/exec` RBAC to the `Cluster-Agent` when needed and inject the service account name of the `Cluster-Agent` as environment variable.

## 3.62.0

* Add `datadog.asm` section to configure various features of the ASM Security Product. Disabled by default
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.62.0
version: 3.63.0
appVersion: "7"
description: Datadog Agent
keywords:
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog

![Version: 3.62.0](https://img.shields.io/badge/Version-3.62.0-informational?style=flat-square) ![AppVersion: 7](https://img.shields.io/badge/AppVersion-7-informational?style=flat-square)
![Version: 3.63.0](https://img.shields.io/badge/Version-3.63.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
10 changes: 10 additions & 0 deletions charts/datadog/templates/cluster-agent-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: DD_CLUSTER_AGENT_SERVICE_ACCOUNT_NAME
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- name: DD_HEALTH_PORT
{{- $healthPort := .Values.clusterAgent.healthPort }}
value: {{ $healthPort | quote }}
Expand Down Expand Up @@ -235,6 +239,12 @@ spec:
- name: DD_ADMISSION_CONTROLLER_AUTO_INSTRUMENTATION_PATCHER_ENABLED
value: "true"
{{- end }}
{{- if .Values.clusterAgent.admissionController.cwsInstrumentation.enabled }}
- name: DD_ADMISSION_CONTROLLER_CWS_INSTRUMENTATION_ENABLED
value: "true"
- name: DD_ADMISSION_CONTROLLER_CWS_INSTRUMENTATION_MODE
value: {{ .Values.clusterAgent.admissionController.cwsInstrumentation.mode | quote }}
{{- end }}
{{ include "ac-agent-sidecar-env" . | nindent 10 }}
- name: DD_REMOTE_CONFIGURATION_ENABLED
value: {{ include "clusterAgent-remoteConfiguration-enabled" . | quote }}
Expand Down
5 changes: 5 additions & 0 deletions charts/datadog/templates/cluster-agent-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ rules:
- apiGroups: ["apps"]
resources: ["statefulsets", "replicasets", "deployments", "daemonsets"]
verbs: ["get"]
{{- if and .Values.clusterAgent.admissionController.cwsInstrumentation.enabled (eq .Values.clusterAgent.admissionController.cwsInstrumentation.mode "remote_copy") }}
- apiGroups: [""]
resources: ["pods/exec"]
verbs: ["create"]
{{- end }}
{{- end }}
{{- if eq (include "should-enable-security-agent" .) "true" }}
{{- if .Values.datadog.securityAgent.compliance.enabled }}
Expand Down
8 changes: 8 additions & 0 deletions charts/datadog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,14 @@ clusterAgent:
# clusterAgent.admissionController.port -- Set port of cluster-agent admission controller service
port: 8000

cwsInstrumentation:
# clusterAgent.admissionController.cwsInstrumentation.enabled -- Enable the CWS Instrumentation admission controller endpoint.
enabled: false

# clusterAgent.admissionController.cwsInstrumentation.mode -- Mode defines how the CWS Instrumentation should behave.
# Options are "remote_copy" or "init_container"
mode: remote_copy

agentSidecarInjection:
# clusterAgent.admissionController.agentSidecarInjection.enabled -- Enables Datadog Agent sidecar injection.

Expand Down

0 comments on commit ad3834f

Please sign in to comment.