If you deployed Dynatrace Operator to a Kubernetes cluster, the easiest way to migrate Kubernetes monitoring from your Managed cluster to your SaaS environment is to reconfigure the Dynatrace Operator deployment. You'll need to update a single configuration to perform Dynatrace Operator reconfiguration at the environment level.
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.
To generate an access token in the target SaaS environment,
You can only access your token once upon creation. You can't reveal it afterward.
Generating a token in the target SaaS environment won't affect your Kubernetes cluster nor your Managed cluster.
To create a new secret (saasdynakube
) holding the new token in the Kubernetes cluster, replace the placeholders in the code sample below (saasdynakube
and <API-TOKEN>
) with your own values, then run the command.
kubectl -n dynatrace create secret generic saasdynakube --from-literal="apiToken=<API-TOKEN>"
Your Kubernetes cluster will then contain the new secret saasdynakube
holding the new token.
To update an existing DynaKube custom resource file with the new secret,
Go to Account Management to find your SaaS [Environment ID].
To start modifying dynakube
custom resource file, run the command below
kubectl edit dynakube dynakube -n dynatrace
Update the configuration parameter values as follows, making sure to replace the placeholders ({your-saas-environment-id}
and saasdynakube
) with your own values
Parameter
Updated value
apiUrl
https://{your-saas-environment-id}.live.dynatrace.com/api
token
saasdynakube
Your existing DynaKube custom resource file will then be updated to reference the new secret saasdynakube
and the SaaS environment.
Restart your applications.
Your OneAgents will then point to the SaaS environment. Because existing connections to the Dynatrace Managed cluster will no longer be active, we recommend deleting any existing secret that is no longer used for this connection.