deprecated
Manually configuring a daemonset to rollout OneAgent on a Kubernetes cluster is deprecated.
We recommend that you leverage Dynatrace Operator and benefit from automated lifecycle management and metadata enrichment. For a clear view of all the deployment strategies, see How it works.
This page describes 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.
ONEAGENT_INSTALLER_SCRIPT_URL
. This information is shared during Dynatrace OneAgent installation.To get your ONEAGENT_INSTALLER_SCRIPT_URL
wget
command:Download or copy the dynatrace-oneagent.yml
Kubernetes template.
apiVersion: apps/v1kind: DaemonSetmetadata:name: dynatrace-oneagentspec:selector:matchLabels:name: dynatrace-oneagenttemplate:metadata:labels:name: dynatrace-oneagentspec:hostPID: truehostIPC: truehostNetwork: truenodeSelector:beta.kubernetes.io/os: linuxvolumes:- name: host-roothostPath:path: /containers:- name: dynatrace-oneagentimage: dynatrace/oneagentenv:- name: ONEAGENT_INSTALLER_SCRIPT_URLvalue: your_URL- name: ONEAGENT_INSTALLER_SKIP_CERT_CHECKvalue: 'false'- name: ONEAGENT_INSTALLER_DOWNLOAD_TOKENvalue: '<API-Token>'args:- '--set-network-zone=<your.network.zone>'volumeMounts:- name: host-rootmountPath: /mnt/rootsecurityContext:privileged: true
ONEAGENT_INSTALLER_DOWNLOAD_TOKEN
is only needed for OneAgent container image versions 1.39+ and is ignored for earlier versions.--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.--set-network-zone=<your.network.zone>
parameter. See network zones for more information.Deploy Dynatrace OneAgent using the created file dynatrace-oneagent.yml
.
Verify that the dynatrace-oneagent
DaemonSet has deployed pods to the cluster nodes successfully:
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 Connect your Kubernetes clusters to Dynatrace.
Whenever a new version of OneAgent becomes available in Dynatrace, you can redeploy 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.
Deploy Dynatrace OneAgent using the dynatrace-oneagent.yml
DaemonSet file.
Delete the dynatrace-oneagent
DaemonSet.
optional After deleting the dynatrace-oneagent
DaemonSet, the OneAgent binary remains on the node in an inactive state. To uninstall it completely, run the uninstall.sh
script and delete logs and configuration files.
See Linux related information.