Deploy OneAgent Daemonset

Learn how you can set up OneAgent on Kubernetes using the OneAgent DaemonSet. DaemonSet is a feature that makes sure that if a copy of a pod on a node dies, the copy is recreated, and if nodes are added to the cluster, copies of the pod are added as well.
For a clear view of all the deployment strategies, see Kubernetes deployment strategies.

Prepare DaemonSet

The first step is locating the ONEAGENT_INSTALLER_SCRIPT_URL. This information is shared during Dynatrace OneAgent installation.

Install DaemonSet

Download or copy the dynatrace-oneagent.yml Kubernetes template.

  • ONEAGENT_INSTALLER_DOWNLOAD_TOKEN is only needed for OneAgent container image versions 1.39+ and is ignored for earlier versions.
  • The --set-app-log-content-access parameter is passed to the OneAgent installer and, when set to true (or 1), allows OneAgent to access log files for the purpose of log monitoring. For more about this and other parameters, see Customize OneAgent installation on Linux.
  • You can configure network zones by setting the --set-network-zone=<your.network.zone> parameter. See network zones for more information.

Deploy Dynatrace OneAgent using the created file dynatrace-oneagent.yml.

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

Verify that the dynatrace-oneagent DaemonSet has deployed pods to the cluster nodes successfully:

$ kubectl get pods --namespace=kube-system
NAME                       READY     STATUS              RESTARTS   AGE
dynatrace-oneagent-abcde   1/1       Running             0          1m
$ kubectl logs -f dynatrace-oneagent-abcde
09:46:18 Using volume-based storage
09:46:18 Started agent deployment as a Docker container, PID 1234.
09:46:18 Downloading agent to /tmp/Dynatrace-OneAgent-Linux.sh via https://EnvironmentID.live.dynatrace.com/api/v1/deployment/installer/agent/unix/default/latest?Api-Token=***&arch=x86&flavor=default
09:46:21 Download complete
09:46:21 Downloaded version: 1.x
09:46:21 Validating downloaded agent installer
09:46:23 Verification successful
...

Limitations

See Docker limitations for details.

Connect your Kubernetes clusters to Dynatrace

Now that you have OneAgent running on your Kubernetes nodes, you're able to monitor those nodes, and the applications running in Kubernetes. The next step is to connect the Kubernetes API to Dynatrace in order to get native Kubernetes metrics, like request limits, and differences in pods requested vs. running pods.
For further instructions see Monitor your Kubernetes clusters with Dynatrace.