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 Kubernetes deployment strategies.

Update OneAgent Operator with kubectl

OneAgent Operator (for Kubernetes version 1.9+) 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.

To update OneAgent Operator, run the following command:

$ kubectl apply -f https://github.com/Dynatrace/dynatrace-oneagent-operator/releases/latest/download/kubernetes.yaml

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 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 apply -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.

For the automated application-only injection, recreate your pods to get the latest OneAgent version available.