Pre-submission Checklist
Helm chart name
datadog
Helm chart version
3.88.3 - 3.160.2, current main as well
Bug Report
What happened:
When clusterAgent.metricsProvider.enabled: true and the chart is installed outside kube-system (e.g. datadog-system), the RoleBinding <release>-cluster-agent-apiserver is created in {{ .Release.Namespace }} but references the Role extension-apiserver-authentication-reader, which only exists in kube-system.
RoleBindings are namespace-scoped and can only reference Roles in the same namespace, so the binding silently does nothing. The Cluster Agent's external metrics API server (port 8443) cannot read the extension-apiserver-authentication ConfigMap and rejects all requests with 403 Forbidden:
RBAC: role.rbac.authorization.k8s.io "extension-apiserver-authentication-reader" not found
This breaks the DatadogMetric CRD flow — all DatadogMetric CRs remain Active: False, Valid: False indefinitely.
The bug is in charts/datadog/templates/cluster-agent-rbac.yaml:
apiVersion: {{ template "rbac.apiVersion" . }}
kind: RoleBinding
metadata:
name: "{{ template "datadog.fullname" . }}-cluster-agent-apiserver"
namespace: {{ .Release.Namespace }} # <-- should be kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
name: {{ template "datadog.fullname" . }}-cluster-agent
namespace: {{ .Release.Namespace }}
What I expected:
The RoleBinding should be created in kube-system where the extension-apiserver-authentication-reader Role exists. This is the standard pattern used by other extension API servers (metrics-server, KEDA).
Steps to Reproduce
- Install the chart in a namespace other than
kube-system:
helm install datadog datadog/datadog -n datadog-system --set clusterAgent.metricsProvider.enabled=true --set clusterAgent.metricsProvider.useDatadogMetrics=true
- Create a
DatadogMetric CR
- Observe it stays
Active: False, Valid: False indefinitely
- Verify the role is missing in the release namespace:
kubectl get role extension-apiserver-authentication-reader -n kube-system # exists
kubectl get role extension-apiserver-authentication-reader -n datadog-system # NotFound
Environment
Kubernetes version: v1.32 (EKS)
Helm version: v4.1.3
Cloud provider: AWS
Additional Context
This likely hasn't been widely reported because most deployments install Datadog in kube-system (where the Role exists) or use the Datadog Operator (which manages its own RBAC).
Suggested fix — change the namespace to kube-system:
apiVersion: {{ template "rbac.apiVersion" . }}
kind: RoleBinding
metadata:
name: "{{ template "datadog.fullname" . }}-cluster-agent-apiserver"
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
name: {{ template "datadog.fullname" . }}-cluster-agent
namespace: {{ .Release.Namespace }}
Pre-submission Checklist
Helm chart name
datadog
Helm chart version
3.88.3 - 3.160.2, current
mainas wellBug Report
What happened:
When
clusterAgent.metricsProvider.enabled: trueand the chart is installed outsidekube-system(e.g.datadog-system), the RoleBinding<release>-cluster-agent-apiserveris created in{{ .Release.Namespace }}but references the Roleextension-apiserver-authentication-reader, which only exists inkube-system.RoleBindings are namespace-scoped and can only reference Roles in the same namespace, so the binding silently does nothing. The Cluster Agent's external metrics API server (port 8443) cannot read the
extension-apiserver-authenticationConfigMap and rejects all requests with403 Forbidden:This breaks the
DatadogMetricCRD flow — all DatadogMetric CRs remainActive: False, Valid: Falseindefinitely.The bug is in
charts/datadog/templates/cluster-agent-rbac.yaml:What I expected:
The RoleBinding should be created in
kube-systemwhere theextension-apiserver-authentication-readerRole exists. This is the standard pattern used by other extension API servers (metrics-server, KEDA).Steps to Reproduce
kube-system:DatadogMetricCRActive: False, Valid: FalseindefinitelyEnvironment
Kubernetes version: v1.32 (EKS)
Helm version: v4.1.3
Cloud provider: AWS
Additional Context
This likely hasn't been widely reported because most deployments install Datadog in
kube-system(where the Role exists) or use the Datadog Operator (which manages its own RBAC).Suggested fix — change the namespace to
kube-system: