cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Automate removal of old ActiveGates and OneAgents

PeterR
Participant

Hi, we multiple dynamic EKS environments that are deployed using Argo & Terraform.
We also deployed the Dynatrace operator (helm chart) and the Dynakube custom resources (helm chart) for each cluster using  Argo & Terraform. We use the Classic Full stack deloyment method because this method is recommended.

Everything is configured as code, and Argo reconciles and scales everything nicely. I can even write a blog about it.

But we have a problem. The clusters shrink and scale and nodes are added and removed on the fly. Also new clusters are added and removed on the fly automatically.

But every time a node (OneAgent) is removed on Kubernetes(Argo) it is not removed in the Dynatrace portal.

So we are left with a lot of OneAgents and Activegates in Dynatrace that not exist anymore. And they still consume Host Units and are billed unfortunately...
It try to erase them using the Dynatrace API but no luck....

curl -X DELETE "https://{environmentid}.live.dynatrace.com/api/v1/oneagents/HOST-CA604A85B22E06EC" -H "Authorization: Api-Token ${DYNA_APITOKEN}"

How can we remove old ActiveGates and  OneAgents and how do I automate this?

3 REPLIES 3

ChadTurner
DynaMight Legend
DynaMight Legend

If the host isn't being monitored it shouldn't be consuming Host Units, or be billing you since billing is consumed by Host Unit Hours. What Oneagent Version are they? what Cluster version are you on? 

 

-Chad

PeterR
Participant

Hi Chad,

The dynatrace operator manages the versions. Currently these are:
activegate version 1.267.118.20230602-131900
oneagent version 1.267.125.20230613-102915

We see that old hosts and oneagents eventually disappear, but it takes a while! I'm not entirely sure for how long they are billed.
We want to at least make it possible to cleanup faster or delete the hosts with an API call...

PeterR
Participant

Currently there are 6 kubernetes clusters connected. These are 52 hosts in total, healthy and consuming...

In the deployment status menu I see:

Showing 934 hosts.
Host unit consumption: 11.355 (for 934 visible hosts) / 11.685 (for 961 total hosts)

Featured Posts