Get started with Kubernetes observability

  • Published Jul 28, 2023

This page provides instructions for deploying the Dynatrace Operator for Kubernetes observability.

To gain a more comprehensive view of your environment that includes aspects such as application observability and user experience, you should consider combining Kubernetes observability with Application Observability if you are on a Dynatrace Platform Subscription (DPS) or use cloud native full stack mode if you are on Dynatrace classic licensing.

Before you begin

Before installing Dynatrace on your Kubernetes cluster, ensure that you meet the following requirements:

  • Your kubectl CLI is connected to the Kubernetes cluster that you want to monitor.
  • You have sufficient privileges on the monitored cluster to run kubectl or oc commands.

Cluster setup and configuration

  • You must allow egress for Dynatrace pods (default: Dynatrace namespace) to your Dynatrace environment URL.

    • For Dynatrace Managed, you can optionally use a Cluster ActiveGate URL.
  • For OpenShift Dedicated, you need the cluster-admin role.

  • Helm installation Use Helm version 3.

Supported versions

See supported Kubernetes/OpenShift platform versions and distributions.

Installation options

Choose one of the installation methods that best suits your needs.

Helm

Dynatrace Operator version 0.8.0+

The following command works for both default installations and installations using an OCI registry.

helm install dynatrace-operator oci://public.ecr.aws/dynatrace/dynatrace-operator \
--set "csidriver.enabled=false" \
--create-namespace \
--namespace dynatrace \
--atomic \

Edit the values.yaml sample from GitHub, and then run the install command, passing the YAML file as an argument:

helm install dynatrace-operator oci://public.ecr.aws/dynatrace/dynatrace-operator \
--create-namespace \
--namespace dynatrace \
--atomic \
-f values.yaml

If installCRD is set to false, you need to create the custom resource definition manually before starting the Helm installation:

kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v1.7.2/dynatrace-operator-crd.yaml

Create a secret named dynakube for the Dynatrace Operator token obtained in Tokens and permissions required.

kubectl -n dynatrace create secret generic dynakube --from-literal="apiToken=<OPERATOR_TOKEN>"

Download the DynaKube custom resource sample for Kubernetes observability from GitHub. In addition, you can review the available parameters or how-to guides, and adapt the DynaKube custom resource according to your requirements.

Run the command below to apply the DynaKube custom resource, making sure to replace <your-DynaKube-CR> with your actual DynaKube custom resource file name. A validation webhook will provide helpful error messages if there's a problem.

kubectl apply -f <your-DynaKube-CR>.yaml

optional

Verify that your DynaKube is running and all pods in your Dynatrace namespace are running and ready.

> kubectl get dynakube -n dynatrace
NAME APIURL STATUS AGE
dynakube https://{your-domain}/e/{your-environment-id}/api Running 45s

In this DynaKube configuration, you should see the following pods:

> kubectl get pods -n dynatrace
NAME READY STATUS RESTARTS AGE
dynakube-activegate-0 1/1 Running 0 50s
dynatrace-operator-7dc8dc7d8c-wmh4z 1/1 Running 0 2m59s
dynatrace-webhook-7bb6957fb5-l8fsq 1/1 Running 0 2m59s
dynatrace-webhook-7bb6957fb5-rqnqk 1/1 Running 0 2m59s

Manifest

kubectl create namespace dynatrace
kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v1.7.2/kubernetes.yaml

Run the following command to see when Dynatrace Operator components finish initialization:

kubectl -n dynatrace wait pod --for=condition=ready --selector=app.kubernetes.io/name=dynatrace-operator,app.kubernetes.io/component=webhook --timeout=300s

Create a secret named dynakube for the Dynatrace Operator token obtained in Tokens and permissions required.

kubectl -n dynatrace create secret generic dynakube --from-literal="apiToken=<OPERATOR_TOKEN>"

Download the DynaKube custom resource sample for Kubernetes observability from GitHub. In addition, you can review the available parameters or how-to guides, and adapt the DynaKube custom resource according to your requirements.

Run the command below to apply the DynaKube custom resource, making sure to replace <your-DynaKube-CR> with your actual DynaKube custom resource file name. A validation webhook will provide helpful error messages if there's a problem.

kubectl apply -f <your-DynaKube-CR>.yaml

optional

Verify that your DynaKube is running and all pods in your Dynatrace namespace are running and ready.

> kubectl get dynakube -n dynatrace
NAME APIURL STATUS AGE
dynakube https://{your-domain}/e/{your-environment-id}/api Running 45s

In this DynaKube configuration, you should see the following pods:

> kubectl get pods -n dynatrace
NAME READY STATUS RESTARTS AGE
dynakube-activegate-0 1/1 Running 0 50s
dynatrace-operator-7dc8dc7d8c-wmh4z 1/1 Running 0 2m59s
dynatrace-webhook-7bb6957fb5-l8fsq 1/1 Running 0 2m59s
dynatrace-webhook-7bb6957fb5-rqnqk 1/1 Running 0 2m59s

Learn more

After you've successfully installed the Dynatrace Operator, you may find the following resources helpful for further learning and troubleshooting.