Hey guys.
All good?
Unfortunately, it is only possible to add tags to pods manually through the Dynatrace API.
Something that should be simple, but unfortunately it isn’t (it could be easier).
I managed it as follows:
curl -L -X POST ‘https://{environmentid}.live.dynatrace.com/api/v2/tags?entitySelector=type%28CLOUD_APPLICATION_INSTANCE%29%2CtoRelationships.isClusterOfCai%28type%28KUBERNETES_CLUSTER%29%2CentityName.in%28%22{YOUR_CLUSTER_NAME_HERE}%22%29%29’ \
-H ‘Authorization: Api-Token {YOUR_API_TOKEN_HERE}’ \
-H ‘Content-Type: application/json’ \
--data-raw '{
“tags”: [
{
“key”: “{YOUR_TAG_HERE}”
}
]
}’
Entities.write token required, this cURL is based on the CMD.
Now I need to try to create a management zone based on these manual tags.