• Home
  • Deploy
  • Set up Dynatrace on container platforms
  • Kubernetes
  • Other configuration options for Kubernetes/OpenShift
  • Migrate Dynatrace Operator to a new Dynatrace environment - Kubernetes/OpenShift

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

  1. Delete the existing secret that holds the API and PaaS tokens for authenticating to the Dynatrace Cluster.

    bash
    kubectl delete secret dynakube -n dynatrace
    bash
    oc delete secret dynakube -n dynatrace
  2. Create a new secret based on new tokens from your new environment (see step 4 of the installation instructions).

  3. Override the old apiUrl in the custom resource file with the new one.

    bash
    kubectl edit dynakube dynakube -n dynatrace
    bash
    oc edit dynakube dynakube -n dynatrace
  4. Restart your applications.

Migration with Helm

  1. Update the OneAgent Operator to include the address of the new environment and its new tokens.

    bash
    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"
    plaintext
    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"
  2. Restart your applications.

Related topics
  • Kubernetes/OpenShift monitoring

    Monitor Kubernetes/OpenShift with Dynatrace.