Update OneAgent on Kubernetes

Find out below how to update OneAgent according to your particular deployment strategy. For a clear view of all the deployment alternatives, see Understanding deployment strategies.

Update OneAgent Operator with helm

Update your helm repositories.

$ helm repo update

Another method of updating the Dynatrace OneAgent helm repository is adding it again, which overwrites the older version.

Update OneAgent to the latest version.

Don't omit the --reuse-values flag in the command in order to keep your configuration.

$ helm upgrade dynatrace-oneagent-operator dynatrace/\
dynatrace-oneagent-operator -n dynatrace --reuse-values

Update OneAgent Operator via kubectl

OneAgent Operator (version 1.9 or higher) automatically takes care of the lifecycle of the deployed OneAgents, so you don't need to update OneAgent pods yourself.

Review the release notes of the Operator for any breaking changes of the custom resource.
If the custom resource of the new version is compatible with the already deployed version, you can simply set the OneAgent Operator image to the new tagged version. Be sure to replace vX.Y.Z with the new version in the following command:

$ kubectl -n dynatrace set image deployment \
dynatrace-oneagent-operator *=quay.io/dynatrace/\
dynatrace-oneagent-operator:vX.Y.Z

Note: The image version of the OneAgent Operator is independent from the OneAgent version. To check the available versions for the Operator, see the OneAgent Operator releases.

Update OneAgent DaemonSet

Whenever a new version of OneAgent becomes available in Dynatrace, you can re-deploy OneAgent as explained in the steps below. The dynatrace-oneagent container will automatically fetch the latest version of Dynatrace OneAgent.

If you've specified a default OneAgent installation version for new hosts and applications in your OneAgent updates settings, the dynatrace-oneagent container will automatically fetch the defined default version of OneAgent.

Delete the dynatrace-oneagent DaemonSet.

$ kubectl delete ds/dynatrace-oneagent

Deploy Dynatrace OneAgent using the dynatrace-oneagent.yml DaemonSet file. Be sure to change the value REPLACE_WITH_YOUR_URL with the Dynatrace OneAgent installer URL.

$ kubectl create -f dynatrace-oneagent.yml --namespace=kube-system
daemonset "dynatrace-oneagent" created

Update OneAgent for application-only monitoring

Each time you want to leverage a new version of Dynatrace OneAgent, you must rebuild your local OneAgent code modules and application image. Any newly started pods from this application image will be monitored with the latest version of OneAgent.

If you've specified a default OneAgent installation version for new hosts and applications using OneAgent update settings, your Kubernetes applications will be automatically monitored by the defined default version of Dynatrace OneAgent.