Deploy OneAgent Operator with helm

Learn how you can set up OneAgent on Kubernetes using the Dynatrace OneAgent Operator helm chart, which is our recommended approach to setting up OneAgent.

Helm is a package manager for Kubernetes. The Dynatrace OneAgent Operator helm chart supports the rollout and lifecycle of Dynatrace OneAgent in Kubernetes clusters.

Helm generates and applies Kubernetes object definitions without the need to make any changes on the YAML files. If you prefer to have more control over those YAML files, use the Operator or DaemonSet deployment strategies.

Prerequisites

  • Generate an API token and a PaaS token in your Dynatrace environment.
    Make sure you have the Access problem and event feed, metrics, and topology switch enabled for the API token.

  • See Support lifecycle for supported Kubernetes versions.

  • Install helm (version 3 required).

Deploy OneAgent Operator

Install the OneAgent Operator by following the steps below.

Add the Dynatrace OneAgent helm repository.

$ helm repo add dynatrace\
https://raw.githubusercontent.com/Dynatrace/helm-charts/master/repos/stable

Create a Dynatrace namespace.
The Dynatrace OneAgent Operator acts on its separate namespace called dynatrace, which holds the operator deployment and all dependent objects like permissions, custom resources, and corresponding DaemonSets.

$ kubectl create namespace dynatrace

Configure the parameters for OneAgent deployment.
Build a helm command using the parameters in the table below to deploy OneAgent to your Kubernetes cluster.

Parameter Description Default value
platform defines whether you want to install the Dynatrace OneAgent Operator on 'kubernetes' or 'openshift' kubernetes
oneagent.apiUrl
  • For Dynatrace SaaS, where OneAgent can connect to the internet, replace the Dynatrace ENVIRONMENTID in https://ENVIRONMENTID.live.dynatrace.com/api.

  • For Dynatrace SaaS, where OneAgent can't connect to the internet, use the following to download the OneAgent, as well as to communicate OneAgent traffic through the ActiveGate: https://YourActiveGateIP or FQDN:9999/e/<ENVIRONMENTID>/api.

  • For Dynatrace Managed, use the following either for an ActiveGate or to connect directly to your server: https://ag, or server IP, or FQDN/e/<ENVIRONMENTID>/api. Note that depending on your settings, you may need the port as well.
secret.apiToken the dynatrace api token
secret.paasToken the dynatrace paas token

Example of a helm command with a basic configuration:

$ helm install dynatrace-oneagent-operator\
dynatrace/dynatrace-oneagent-operator -n\
dynatrace --set platform="kubernetes",\
oneagent.apiUrl="https://ENVIRONMENTID.live.dynatrace.com/api",\
secret.apiToken="DYNATRACE_API_TOKEN",\
secret.paasToken="PLATFORM_AS_A_SERVICE_TOKEN"

Required configuration for Anthos, CaaS, GKE, and PKS

GKE, Anthos, CaaS, and PKS require some special parameters described below.

Connect your Kubernetes clusters to Dynatrace

Now that you have OneAgent running on your Kubernetes nodes, you are 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.