Deploy OneAgent
We will provide step-by-step instruction to help you get started quickly. For in depth product documentation, please visit the following Dynatrace Documentation pages: 1. Set up Dynatrace on Kubernetes 2. Dynatrace ActiveGate 3. Dynatrace OneAgent

Step 1:

From your Dynatrace environment, navigate to Infrastructure and then Kubernetes in the left navigation menu as shown below:
Select Add Custer.

Step 2:

Provide a name for your connection as shown below:
This name simplifies deployment and is used by various Dynatrace settings including Kubernetes cluster name, Network Zone, ActiveGate Group, and Host Group. For individually unique settings follow activation instructions from Kubernetes monitoring documentation.
Then click on Create tokens.
DO NOT leave this menu. You will need to copy and paste a few things and switch to your terminal and back for the remaining steps. If you navigate away from this menu, you will need to create new tokens and break the process.

Step 3:

From your terminal, create a namespace and deploy the Dynatrace Operator into your K8s cluster.
1
kubectl create namespace dynatrace
2
kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/latest/download/kubernetes.yaml
Copied!
Next, copy and paste the PaaS Token & API Token from Step 2 into the following command:
1
kubectl -n dynatrace create secret generic dynakube --from-literal="apiToken=DYNATRACE_API_TOKEN" --from-literal="paasToken=PLATFORM_AS_A_SERVICE_TOKEN"
Copied!

Step 4:

Go back to your Dynatrace environment Dashboard and copy the command shown below.
Once copied, switch back to your terminal and execute the example command:
1
wget https://github.com/dynatrace/dynatrace-operator/releases/latest/download/install.sh \
2
-O install.sh && sh ./install.sh --api-url "$YOUR_API_URL" \
3
--api-token "$YOUR_API_TOKEN" \
4
--paas-token "$YOUR_PASS_TOKEN" \
5
--cluster-name "$YOUR_CLUSTER_NAME"
Copied!
Where $YOUR_API_URL is that of your Dynatrace tenant, $YOUR_API_TOKEN, $YOUR_PASS_TOKEN and $YOUR_CLUSTER_NAME are those created above. If successful, you will see results similar to what is shown below:
1
Check for token scopes...
2
3
Check if cluster already exists...
4
5
Creating Dynatrace namespace...
6
7
Applying Dynatrace Operator...
8
customresourcedefinition.apiextensions.k8s.io/dynakubes.dynatrace.com configured
9
serviceaccount/dynatrace-dynakube-oneagent unchanged
10
serviceaccount/dynatrace-dynakube-oneagent-unprivileged unchanged
11
serviceaccount/dynatrace-kubernetes-monitoring unchanged
12
serviceaccount/dynatrace-operator unchanged
13
serviceaccount/dynatrace-routing unchanged
14
role.rbac.authorization.k8s.io/dynatrace-operator unchanged
15
clusterrole.rbac.authorization.k8s.io/dynatrace-kubernetes-monitoring unchanged
16
clusterrole.rbac.authorization.k8s.io/dynatrace-operator unchanged
17
rolebinding.rbac.authorization.k8s.io/dynatrace-operator unchanged
18
clusterrolebinding.rbac.authorization.k8s.io/dynatrace-kubernetes-monitoring unchanged
19
clusterrolebinding.rbac.authorization.k8s.io/dynatrace-operator unchanged
20
deployment.apps/dynatrace-operator unchanged
21
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
22
secret/dynakube configured
23
24
Applying DynaKube CustomResource...
25
dynakube.dynatrace.com/dynakube created
26
27
Adding cluster to Dynatrace...
28
Kubernetes monitoring successfully setup.
Copied!
That's it! You are ready to move to the next section.
Last modified 2d ago
Export as PDF
Copy link
Edit on GitHub