Dynatrace Operator version 1.11.0+
Consolidate the kubernetes-monitoring ActiveGate capability into the DynaKube that configures your routing ActiveGate and OneAgent monitoring, using spec.kubernetesMonitoring. This simplifies cluster configuration and reduces the number of DynaKube resources to maintain.
Starting with Dynatrace Operator version 1.11.0, spec.kubernetesMonitoring lets you configure Kubernetes monitoring alongside routing and OneAgent in a single DynaKube. The underlying functionality is unchanged; only the configuration moves.
# DynaKube 1: Kubernetes monitoringapiVersion: dynatrace.com/v1beta6kind: DynaKubemetadata:name: dynakubenamespace: dynatracespec:activeGate:capabilities:- kubernetes-monitoringresources:requests:cpu: 1000mmemory: 10Gilimits:cpu: 2000mmemory: 10Gireplicas: 1kspm:mappedHostPaths:- /boot- /etc- /proc/sys/kernel- /sys/fs- /sys/kernel/security/apparmor- /usr/lib/systemd/system- /var/lib---# DynaKube 2: OneAgent + routing ActiveGateapiVersion: dynatrace.com/v1beta6kind: DynaKubemetadata:name: k8s-agentsnamespace: dynatracespec:oneAgent:cloudNativeFullStack:tolerations:- effect: NoSchedulekey: node-role.kubernetes.io/masteroperator: Exists- effect: NoSchedulekey: node-role.kubernetes.io/control-planeoperator: ExistsactiveGate:capabilities:- routing- debuggingresources:requests:cpu: 500mmemory: 4Gilimits:cpu: 2000mmemory: 4Gireplicas: 3logMonitoring: {}telemetryIngest:protocols:- jaeger- otlp- statsd- zipkinserviceName: telemetry-ingest
capabilities: [kubernetes-monitoring] and another using capabilities: [routing]kubectl CLI access to the clusterDo not create a new DynaKube resource while your existing DynaKubes are still running. Dynatrace Operator rejects a DynaKube that conflicts with another one over OneAgent node assignment, namespace injection, or telemetry ingest service names.
Always add spec.kubernetesMonitoring to the DynaKube that configures your routing ActiveGate and OneAgent monitoring first, then delete the dedicated Kubernetes monitoring DynaKube.
Edit the DynaKube that does not have the kubernetes-monitoring capability and add spec.kubernetesMonitoring.
Transfer the spec.activeGate settings from your Kubernetes monitoring DynaKube into spec.kubernetesMonitoring, and move over any other top-level sections (such as spec.kspm). Most spec.activeGate fields map directly: image, imagePullPolicy, nodeSelector, tolerations, env, labels, annotations, customProperties, and group.
If you use spec.kspm, spec.kubernetesMonitoring must have registration configured, and replicas cannot exceed 1. Dynatrace Operator rejects higher values when KSPM is configured.
spec:activeGate:capabilities:- routing # your existing capabilities stay unchangedkubernetesMonitoring:replicas: 1registration: {}resources:requests:cpu: 1000mmemory: 10Gilimits:cpu: 2000mmemory: 10Gi
With spec.kubernetesMonitoring, cluster registration is not configured automatically. Add registration: {} to keep your cluster registered in Dynatrace. The DynaKube name change does not create a duplicate cluster. Dynatrace identifies your cluster independently of the DynaKube name.
If you set a custom cluster name using the automatic-kubernetes-api-monitoring-cluster-name feature flag annotation, move that value to kubernetesMonitoring.registration.clusterName. Dynatrace Operator does not migrate annotation values automatically.
For all available spec.kubernetesMonitoring parameters, see DynaKube parameters.
Apply the updated DynaKube:
kubectl apply -f dynakube.yaml
Wait for the new Kubernetes monitoring StatefulSet to become ready before deleting the old DynaKube. The two StatefulSets overlap briefly, which is expected. Deleting the old DynaKube early causes a monitoring gap.
kubectl rollout status statefulset/<dynakube-name>-kubemon -n dynatrace
Check the KubernetesMonitoringAvailable condition on your DynaKube:
kubectl get dynakube <dynakube-name> -n dynatrace \-o jsonpath='{.status.conditions[?(@.type=="KubernetesMonitoringAvailable")].status}'
The condition returns True when all Kubernetes monitoring resources are ready. While it reconciles, it returns False with reason Reconciling. On failure, it returns False with reason Error.
Delete the Kubernetes monitoring DynaKube:
kubectl delete dynakube <k8s-monitoring-dynakube-name> -n dynatrace
Confirm the new StatefulSet is present and the old one is gone:
kubectl get statefulsets -n dynatrace
A StatefulSet named <dynakube-name>-kubemon appears. No StatefulSet from the deleted DynaKube remains.
In the Dynatrace UI, go to Infrastructure > Kubernetes to confirm your cluster is visible and receiving data. The existing cluster entity and its data are preserved. No duplicate cluster is created.
spec.kubernetesMonitoring parameters in DynaKube parameters.