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

What AWS AZ a Pod is in?

shakib
Guide

I'm trying to create a dashboard or a DQL query that gives me the AZ all of my pods are in. I see that in the EC2 Node metadata I can see what AZ those nodes are in, and of course I can see what AZ the pods running on that node are in, but I want the information in one single view with all of the pods (or filterable list). 
Anyone know how I can achieve this with DQL or a dashboard query? 

1 REPLY 1

Akhil-Jayendran
Advisor

Hi @shakib ,

 

May be you can try this 

 

fetch dt.entity.cloud_application_instance
| fieldsAdd nodeid=runs_on[dt.entity.kubernetes_node]
| lookup [fetch dt.entity.kubernetes_node| fields id, node.id = id, node.name = entity.name,cluster.id = belongs_to[dt.entity.host]], sourceField: nodeid, lookupField: node.id 
| fieldsRemove nodeid, lookup.id, lookup.node.id
| fieldsRename host_id=lookup.cluster.id, hostname=lookup.node.name
| lookup [fetch dt.entity.host | fields id,Az_id = belongs_to[dt.entity.aws_availability_zone]], sourceField:host_id,lookupField:id
| fieldsRename az_id=lookup.Az_id, hostid=lookup.id
| lookup [fetch dt.entity.aws_availability_zone], sourceField:az_id, lookupField:id
| fieldsRename PodName=entity.name, availability_zone=lookup.entity.name
| fieldsKeep PodName, hostname, availability_zone

You might get a result like this.

Screenshot 2025-06-04 at 11.42.00 PM.png

 

BR

 

Consultant | TEKsystems

Featured Posts