Migrate Dynatrace Operator
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.
Generate a token
Create a new secret
Update DynaKube custom resource file
Generate a token
To generate an access token in the target SaaS environment,
- In the Dynatrace menu, select Access tokens.
- Select Generate new token.
- Enter a name for your token.
Dynatrace doesn't enforce unique token names. You can create multiple tokens with the same name. Be sure to provide a meaningful name for each token you generate. Proper naming helps you to efficiently manage your tokens and perhaps delete them when they're no longer needed. - Select the template Kubernetes: Dynatrace Operator.
This will automatically add the required scopes (see Operator token). - Select Generate token.
- Copy the generated token to the clipboard. Store the token in a password manager for future use.
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.
Create a new secret
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>"
oc -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.
Update DynaKube custom resource file
To update an existing DynaKube custom resource file with the new secret,
-
Learn your SaaS Environment ID by going to User menu > Account settings.
-
To start modifying
dynakube
custom resource file, run the command belowkubectl edit dynakube dynakube -n dynatrace
oc edit dynakube dynakube -n dynatrace
-
Update the configuration parameter values as follows, making sure to replace the placeholders (
{your-saas-environment-id}
andsaasdynakube
) with your own valuesParameter 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.