Migrate Dynatrace Operator to a new environment
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.
-
Delete the existing DynaKube (starting with Dynatrace Operator version 1.3.0, editing spec.apiUrl
is not allowed).
kubectl delete dynakube dynakube -n dynatrace
-
Delete the existing secret that holds the Dynatrace Operator and Data Ingest tokens for authenticating to the Dynatrace Cluster.
kubectl delete secret dynakube -n dynatrace
-
Create a new secret based on new tokens from your new environment.
kubectl -n dynatrace create secret generic dynakube --from-literal="apiToken=<OPERATOR_TOKEN>" --from-literal="dataIngestToken=<DATA_INGEST_TOKEN>"
-
Apply the new DynaKube with the updated spec.apiUrl
.
kubectl apply -f dynakube.yaml
-
Restart your applications.
-
Delete the existing DynaKube (starting with Dynatrace Operator version 1.3.0, editing spec.apiUrl
is not allowed).
oc delete dynakube dynakube -n dynatrace
-
Delete the existing secret that holds the Dynatrace Operator and Data Ingest tokens for authenticating to the Dynatrace Cluster.
oc delete secret dynakube -n dynatrace
-
Create a new secret based on new tokens from your new environment.
oc -n dynatrace create secret generic dynakube --from-literal="apiToken=<OPERATOR_TOKEN>" --from-literal="dataIngestToken=<DATA_INGEST_TOKEN>"
-
Apply the new DynaKube with the updated spec.apiUrl
.
oc apply -f dynakube.yaml
-
Restart your applications.