This page provides instructions for deploying the Dynatrace Operator for Kubernetes platform monitoring.
If you’re looking to gain deeper insights into your Kubernetes environment, check out the deployment overview to learn about Application observability and Full-Stack observability. You can further expand your Kubernetes observability on Log Analytics, Digital Experience, and Application Security.
Before installing Dynatrace on your Kubernetes cluster, ensure that you meet the following requirements:
kubectl
CLI is connected to the Kubernetes cluster that you want to monitor.kubectl
or oc
commands.You must allow egress for Dynatrace pods (default: Dynatrace namespace) to your Dynatrace environment URL.
For OpenShift Dedicated, you need the cluster-admin role.
Helm installation Use Helm version 3.
See supported Kubernetes/OpenShift platform versions and distributions.
Choose one of the installation methods that best suits your needs.
Dynatrace Operator version 0.8.0+
Install Dynatrace Operator
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 \
When upgrading your Kubernetes observability setup to include application monitoring, we recommend that you install the CSI driver for improved efficiency. If you plan to expand towards cloud-native full-stack observability, installation of the CSI driver becomes mandatory.
When upgrading your Kubernetes observability setup to include application monitoring, we recommend that you install the CSI driver for improved efficiency. If you plan to expand towards cloud-native full-stack observability, installation of the CSI driver becomes mandatory.
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.4.1/dynatrace-operator-crd.yaml
Create secret for access token
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>"
Create your DynaKube custom resource file.
You can review the available parameters or how-to guides, and adapt the DynaKube custom resource according to your requirements.
apiVersion: dynatrace.com/v1beta3kind: DynaKubemetadata:name: dynakubenamespace: dynatraceannotations:feature.dynatrace.com/k8s-app-enabled: "true"spec:# For detailed instructions on DynaKube parameters in the spec section, visit https://docs.dynatrace.com/docs/ingest-from/setup-on-k8s/reference/dynakube-parameters# Dynatrace apiUrl including the /api path at the end.# Replace 'ENVIRONMENTID' with your environment ID.# For instructions on how to determine the environment ID and how to configure the apiUrl address, see https://www.dynatrace.com/support/help/reference/dynatrace-concepts/environment-id/.apiUrl: https://ENVIRONMENTID.live.dynatrace.com/apimetadataEnrichment:enabled: trueactiveGate:capabilities:- kubernetes-monitoringresources:requests:cpu: 500mmemory: 512Milimits:cpu: 1000mmemory: 1.5Gi
Apply the DynaKube custom resource
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 deployment
Verify that your DynaKube is running and all pods in your Dynatrace namespace are running and ready.
> kubectl get dynakube -n dynatraceNAME APIURL STATUS AGEdynakube https://<ENVIRONMENTID>.live.dynatrace.com/api Running 45s
In this DynaKube configuration, you should see the following pods:
> kubectl get pods -n dynatraceNAME READY STATUS RESTARTS AGEdynakube-activegate-0 1/1 Running 0 50sdynatrace-operator-7dc8dc7d8c-wmh4z 1/1 Running 0 2m59sdynatrace-webhook-7bb6957fb5-l8fsq 1/1 Running 0 2m59sdynatrace-webhook-7bb6957fb5-rqnqk 1/1 Running 0 2m59s
Create a dynatrace
namespace
kubectl create namespace dynatrace
Install Dynatrace Operator
kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/download/v1.4.1/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 secret for access token
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>"
Create your DynaKube custom resource YAML file.
You can review the available parameters or how-to guides, and adapt the DynaKube custom resource according to your requirements.
apiVersion: dynatrace.com/v1beta3kind: DynaKubemetadata:name: dynakubenamespace: dynatraceannotations:feature.dynatrace.com/k8s-app-enabled: "true"spec:# For detailed instructions on DynaKube parameters in the spec section, visit https://docs.dynatrace.com/docs/ingest-from/setup-on-k8s/reference/dynakube-parameters# Dynatrace apiUrl including the /api path at the end.# Replace 'ENVIRONMENTID' with your environment ID.# For instructions on how to determine the environment ID and how to configure the apiUrl address, see https://www.dynatrace.com/support/help/reference/dynatrace-concepts/environment-id/.apiUrl: https://ENVIRONMENTID.live.dynatrace.com/apimetadataEnrichment:enabled: trueactiveGate:capabilities:- kubernetes-monitoringresources:requests:cpu: 500mmemory: 512Milimits:cpu: 1000mmemory: 1.5Gi
Apply the DynaKube custom resource
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 deployment
Verify that your DynaKube is running and all pods in your Dynatrace namespace are running and ready.
> kubectl get dynakube -n dynatraceNAME APIURL STATUS AGEdynakube https://<ENVIRONMENTID>.live.dynatrace.com/api Running 45s
In this DynaKube configuration, you should see the following pods:
> kubectl get pods -n dynatraceNAME READY STATUS RESTARTS AGEdynakube-activegate-0 1/1 Running 0 50sdynatrace-operator-7dc8dc7d8c-wmh4z 1/1 Running 0 2m59sdynatrace-webhook-7bb6957fb5-l8fsq 1/1 Running 0 2m59sdynatrace-webhook-7bb6957fb5-rqnqk 1/1 Running 0 2m59s
Kubernetes platform monitoring requires Dynatrace Platform Subscription (DPS) and is licensed by number of pods per hour (pod-hours).
After you've successfully installed the Dynatrace Operator, you may find the following resources helpful for further learning and troubleshooting.
Start to analyze your Kubernetes clusters and containerized Apps with Dynatrace and benefit from actionable answers.
Learn how you can configure Dynatrace Operator to support specific use cases.
Troubleshoot any challenges you may encounter while working with the Dynatrace Operator and its various components.
Want to learn more about the Dynatrace components in your Kubernetes cluster?
API reference and configuration options for all Dynatrace components within your Kubernetes cluster.
See release notes for Dynatrace Operator.
This page provides a detailed instructions on how to update and uninstall Dynatrace Operator.