Activate ActiveGate on Kubernetes using Dynatrace Operator

Starting with Dynatrace version 1.215, Dynatrace Operator manages the lifecycle of several Dynatrace components such as OneAgent and Kubernetes API Monitor. The DynaKube custom resource replaces the OneAgent custom resource. The DynaKube CR can deploy different ActiveGate pods to your Kubernetes cluster. For each module, you need to deploy a different ActiveGate. See ActiveGate purposes for details.

1. Connect your clusters to Dynatrace

Some Kubernetes pages require that your Kubernetes clusters be connected to Dynatrace. This connection creates relationships among applications, services, processes, hosts, and Kubernetes objects such as pods and namespaces.

To connect your clusters,

  1. Get the Kubernetes API URL.
kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}'
  1. Get the bearer token.
kubectl get secret $(kubectl get sa dynatrace-kubernetes-monitoring -o jsonpath='{.secrets[0].name}' -n dynatrace) -o jsonpath='{.data.token}' -n dynatrace | base64 --decode
  1. In the Dynatrace menu, go to Settings > Cloud and virtualization > Kubernetes.
  2. Select Connect new cluster.
  3. Provide a Name, the Kubernetes API URL, and the Bearer token for the Kubernetes cluster.

Note: For Rancher distributions, you need the bearer token that was created in the Rancher web UI, as described in Special instructions for Rancher distributions to get the API URL and the bearer token above.

  1. Turn on Enable monitoring and Show workloads and cloud applications.

In Dynatrace environments earlier than version 1.190, you need to turn on Cloud application and workload detection in the Process group detection settings. This way, cloud applications and workloads will be detected properly and process groups won't be spread across different cloud applications and workloads.

  1. Select Connect to save your configuration.

2. Configure ActiveGate for the Kubernetes API Monitoring module

To enable and configure Kubernetes API Monitoring, adjust the Kubernetes API Monitoring parameters in the Dynakube custom resource:

Parameter Description Default value
kubernetesMonitoring.enabled Optional Enable Kubernetes monitoring functionality. false
kubernetesMonitoring.replicas Optional Number of replicas of ActiveGate pods. 1
kubernetesMonitoring.tolerations Optional Tolerations to include with the ActiveGate StatefulSet.
For details, see Taints and Tolerations.
kubernetesMonitoring.nodeSelector Optional Node selector to control on which nodes the OneAgent will be deployed. {}
kubernetesMonitoring.resources Optional Resource settings for ActiveGate container. Consumption of the ActiveGate heavily depends on the workload to monitor; please adjust values accordingly.
kubernetesMonitoring.labels Optional Your defined labels for ActiveGate pods in order to structure workloads as desired.
kubernetesMonitoring.args Optional Set additional arguments to the ActiveGate pods.
kubernetesMonitoring.env Optional Set additional environment variables to the ActiveGate pods. Optional Set activation group for ActiveGate. See Customize ActiveGate properties for details.
kubernetesMonitoring.customProperties Optional Add a custom properties file by providing it as a value or reference it from a secret.
Note: when referencing it from a secret, make sure the key is called customProperties. See Customize ActiveGate properties for details.

Configure ActiveGate for the message routing module

To let ActiveGate know about the runtime structure of your Dynatrace environment and route messages from OneAgents to the correct server endpoints routing functionality, set the following parameter in the DynaKube custom resource:

Parameter Description Default value
routing.enabled Optional Enable routing functionality. false