Migrate Dynatrace Operator to a new Dynatrace environment - Kubernetes/OpenShift
If you're currently monitoring your Kubernetes cluster with a Dynatrace OneAgent rolled out through the Dynatrace Operator and you need to migrate to a different Dynatrace environment, select one of the following options, based on your deployment method.
Each OneAgent image from your environment registry has connection information for that environment, so make sure you use the corresponding image.
Migration with kubectl
/oc
-
Delete the existing secret that holds the API and PaaS tokens for authenticating to the Dynatrace Cluster.
kubectl delete secret dynakube -n dynatrace
oc delete secret dynakube -n dynatrace
-
Create a new secret based on new tokens from your new environment (see step 4 of the installation instructions).
-
Override the old
apiUrl
in the custom resource file with the new one.kubectl edit dynakube dynakube -n dynatrace
oc edit dynakube dynakube -n dynatrace
-
Restart your applications.
Migration with Helm
-
Update the OneAgent Operator to include the address of the new environment and its new tokens.
helm upgrade dynatrace-operator dynatrace/dynatrace-operator -n dynatrace --set platform="kubernetes",\ apiUrl="https://NEW_ENVIRONMENTID.live.dynatrace.com/api",\ apiToken="NEW_DYNATRACE_API_TOKEN",\ paasToken="NEW_PLATFORM_AS_A_SERVICE_TOKEN"
helm upgrade dynatrace-operator dynatrace/dynatrace-operator -n dynatrace --set platform="openshift",\ apiUrl="https://NEW_ENVIRONMENTID.live.dynatrace.com/api",\ apiToken="NEW_DYNATRACE_API_TOKEN",\ paasToken="NEW_PLATFORM_AS_A_SERVICE_TOKEN"
-
Restart your applications.