# How to get the cloud provider name from Kubertenes

**URL:** <https://community.dynatrace.com/t/how-to-get-the-cloud-provider-name-from-kubertenes/49748>\
**Category:** DQL\
**Tags:** dql, kubernetes\
**Created:** [January 16, 2025, 6:13am UTC](https://community.dynatrace.com/t/how-to-get-the-cloud-provider-name-from-kubertenes/49748 "2025-01-16T06:13:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![agravier](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agravier/32/29303_2.png) [@agravier](https://community.dynatrace.com/u/agravier)\
**Post date:** [January 16, 2025, 6:13am UTC](https://community.dynatrace.com/t/how-to-get-the-cloud-provider-name-from-kubertenes/49748/1 "2025-01-16T06:13:06Z")

</div>

Hello,

The only way I’ve found to determine whether a cluster is running on AKS or EKS is to use a classicEntitySelector like this:

```markup
fetch dt.entity.cloud_application_namespace
| filter in (id, classicEntitySelector("""type(CLOUD_APPLICATION_NAMESPACE),toRelationships.isClusterOfNamespace(type(KUBERNETES_CLUSTER),fromRelationships.isClusterOfNode(type(KUBERNETES_NODE),kubernetesProviderType("PROVIDER_TYPE_EKS")))"""))
| fieldsAdd CLOUD_PROVIDER = "AWS"
| append [
fetch dt.entity.cloud_application_namespace
| filter in (id, classicEntitySelector("""type(CLOUD_APPLICATION_NAMESPACE),toRelationships.isClusterOfNamespace(type(KUBERNETES_CLUSTER),fromRelationships.isClusterOfNode(type(KUBERNETES_NODE),kubernetesProviderType("PROVIDER_TYPE_AKS")))"""))
| fieldsAdd CLOUD_PROVIDER = "AZURE"]

```

It’s quite limiting, because I can only use the classicEntitySelector through a filter.

As a result, I have to repeat the command through multiple appends, and I’m unable to handle cloud providers that aren’t explicitly declared.

Do you have another idea for collecting this information?

Thanks. Aurélien.

---

<div class="post-metadata">

**Author:** ![amine\_bergi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/amine_bergi/32/13193_2.png) [@amine\_bergi](https://community.dynatrace.com/u/amine_bergi)\
**Post date:** [January 20, 2025, 5:47pm UTC](https://community.dynatrace.com/t/how-to-get-the-cloud-provider-name-from-kubertenes/49748/2 "2025-01-20T17:47:09Z")

</div>

Hello Aurélien,&nbsp;  
The property&nbsp;kubernetesProviderType is already present in the node entity, so you can use it without using the&nbsp; classicEntitySelector.&nbsp;  
Here’s the dql statement that you could use for instance:

```markup
fetch dt.entity.cloud_application_namespace
| fields namespace_name=entity.name,clustered_by[dt.entity.kubernetes_cluster]
| join [fetch dt.entity.kubernetes_node | fields clustered_by[dt.entity.kubernetes_cluster] , kubernetesProviderType], on:{`clustered_by[dt.entity.kubernetes_cluster]`}
| fieldsAdd cluster=entityName(`clustered_by[dt.entity.kubernetes_cluster]`,type:"dt.entity.kubernetes_cluster"),provider_type=right.kubernetesProviderType
|fieldskeep cluster, namespace_name,provider_type

```

Amine

---

<div class="post-metadata">

**Author:** ![agravier](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agravier/32/29303_2.png) [@agravier](https://community.dynatrace.com/u/agravier)\
**Post date:** [January 21, 2025, 8:26am UTC](https://community.dynatrace.com/t/how-to-get-the-cloud-provider-name-from-kubertenes/49748/3 "2025-01-21T08:26:25Z")

</div>

Hello&nbsp;[@amine\_bergi](https://community.dynatrace.com/user/5003)&nbsp;  
Perfect, thank you for your help.  
Regards
