Migrate from classic to cloud-native full-stack mode
Dynatrace Operator version 1.0.0+
This guide describes the steps required to migrate your Dynatrace deployment from classic full-stack to the cloud-native full-stack mode.
Reasons for migration
The cloud-native full-stack deployment mode represents a major advancement in security, utilizing cloud-native methods for agent injection. This approach addresses two key limitations found in the traditional full-stack mode:
The cloud-native injection mode prevents race conditions that can occur when OneAgent DaemonSet pods and monitored application pods start simultaneously.
By leveraging Kubernetes concepts such as admission webhooks and CSI driver for OneAgent injection, the cloud-native mode reduces the required privileges for OneAgent.
Please thoroughly review considerations and implications in the following section before proceeding with the migration.
Considerations and implications
This section outlines the implications and consequences of the migration, detailing them as follows:
Shortly after OneAgents are deactivated, deep monitoring of applications will stop. Consequently, the restart of all application pods requiring deep monitoring becomes mandatory. Restarting these pods will ensure that applications are reinjected, allowing deep monitoring to resume.
In cloud-native full-stack mode, Host IDs are determined differently, leading to the temporary presence of both new and old hosts in the host list screens. Old host entities and their associated data will adhere to Dynatrace's data retention policy, remaining accessible for the duration specified.
- In cloud-native full-stack mode, container monitoring rules are ignored. Instead, label selectors should be employed to precisely manage agent injection.
Taking these factors into account, the migration undoubtedly demands careful planning due to its complexity, particularly in larger environments or organizations.
Migrate to cloud-native full-stack
This section provides all neccessary information to perform the migration from classic to cloud-native full-stack mode. Please ensure you have thoroughly read and understood the preceding sections Reasons for migration and Considerations and implications before proceeding with the migration, if you have not already done so.
The standard migration procedure requires OneAgent version 1.281 or higher for Kubernetes clusters using CRI-O as their container runtime. Consequently, please upgrade OneAgents before continuing with the steps below. If an upgrade cannot be performed, these instructions describe an alternative migration flow.
Follow these step-by-step instructions to successfully migrate from classic to cloud-native full-stack mode:
-
Reconfigure (existing) DynaKube for cloud-native full-stack mode:
For information on how to configure DynaKube for cloud-native full-stack mode, please review the deployment guide or DynaKube parameters. Alternatively, download the DynaKube custom resource sample for cloud-native full-stack from GitHub and adapt the DynaKube custom resource according to your requirements.
-
Apply the DynaKube custom resource:
Run the command below to apply the DynaKube custom resource. A validation webhook will provide helpful error messages if there's a problem.
kubectl apply -f dynakube.yamlThis action will lead to the removal of OneAgents in classic full-stack mode and subsequently result in the termination of deep monitoring for application pods shortly thereafter.
-
Wait for OneAgents to become ready:
The Dynatrace Operator will pick up the changes in the DynaKube custom resource and perform a rollout of new OneAgents. Wait for the new set of OneAgents to start up and become ready.
-
Restart application workloads:
Restart all application workloads promptly to trigger OneAgent injection and enable deep monitoring preventing/minimizing monitoring outages.
Running CRI-O with OneAgent versions 1.279 or earlier
This section outlines the specific migration procedure for Kubernetes clusters utilizing CRI-O container runtime and running OneAgent version 279 or lower.
Prior to shifting to cloud-native full-stack mode, it's necessary to remove CRI-O hooks installed and utilized for agent injection by the OneAgent in classic full-stack mode. For additional details on CRI-O hooks, refer to this Red Hat blog post.
If possible, we recommended to upgrade OneAgents to version 1.281 and higher and proceed with the standard migration procedure for an easier migration flow.
Follow these step-by-step instructions to successfully migrate from classic to cloud-native full-stack mode:
-
Delete DynaKube custom resource:
Delete the DynaKube configured in classic full-stack mode by running the following command:
kubectl delete dynakube -n dynatrace <dynakube-name>This action will lead to the removal of OneAgents in classic full-stack mode and subsequently result in the termination of deep monitoring for application pods shortly thereafter. Additionally, if Kubernetes monitoring is configured in the DynaKube custom resource, Kubernetes monitoring will stop instantly with the removal of the ActiveGate.
-
Wait for the OneAgent pods to terminate.
-
Run uninstall script:
Execute the
uninstall.sh
script on each node previously monitored by OneAgent to remove mentioned CRI-O hooks:/opt/dynatrace/oneagent/agent/uninstall.sh -
Configure DynaKube custom resource:
For information on how to configure DynaKube for cloud-native full-stack mode, please review the deployment guide or DynaKube parameters. Alternatively, download the DynaKube custom resource sample for cloud-native full-stack from GitHub and adapt the DynaKube custom resource according to your requirements.
-
Apply DynaKube custom resource:
Run the command below to apply the DynaKube custom resource configured for cloud-native full-stack monitoring. A validation webhook will provide helpful error messages if there's a problem.
kubectl apply -f dynakube.yaml -
Wait for OneAgents to become ready:
The Dynatrace Operator will pick up the changes in the DynaKube custom resource and perform a rollout of new OneAgents. Wait for the new set of OneAgents to start up and become ready.
-
Restart application workloads:
Restart all application workloads promptly to trigger OneAgent injection and enable deep monitoring preventing/minimizing monitoring outages.
Changes in Kubernetes resources
The migration impacts several Kubernetes resources, altering their functions or introducing new components to support the cloud-native injection mode. Key changes include:
Component | Classic | Cloud-native |
---|---|---|
OneAgent |
|
|
Dynatrace Webhook Server |
|
|
Dynatrace CSI Driver |
|
|