# What is the correct IP Address of Kubernetes Node coming from the payload?

**URL:** <https://community.dynatrace.com/t/what-is-the-correct-ip-address-of-kubernetes-node-coming-from-the-payload/45362>\
**Category:** Dynatrace API\
**Tags:** kubernetes, dynatrace-api\
**Created:** [April 30, 2024, 11:15am UTC](https://community.dynatrace.com/t/what-is-the-correct-ip-address-of-kubernetes-node-coming-from-the-payload/45362 "2024-04-30T11:15:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mango\_byte](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mango\_byte](https://community.dynatrace.com/u/mango_byte)\
**Post date:** [April 30, 2024, 11:15am UTC](https://community.dynatrace.com/t/what-is-the-correct-ip-address-of-kubernetes-node-coming-from-the-payload/45362/1 "2024-04-30T11:15:21Z")

</div>

Hi,

I am trying to fetch KUBERNETES\_NODE from Dynatrace v2 API, and I am getting the below payload, I want to use the IP Address value for the Node, but as you can see inside properties there is an array of internalIPAddresses which I am not confident to use as it is an array, so can contain more values in future, can you tell me which JSON key is correct here to fetch the value.

{“totalCount”: 1,“pageSize”: 50,“entities”: [{“entityId”: “KUBERNETES\_NODE-6C3263148CCF0B35”,“type”: “KUBERNETES\_NODE”,“displayName”: “ip-10-2-0-116.us-east-2.compute.internal”,“properties”: {“kubernetesNodeConditions”: {“Ready”: “NODE\_CONDITION\_TRUE”,“MemoryPressure”: “NODE\_CONDITION\_FALSE”,“DiskPressure”: “NODE\_CONDITION\_FALSE”,“PIDPressure”: “NODE\_CONDITION\_FALSE”},“detectedName”: “ip-10-2-0-116.us-east-2.compute.internal”,“internalIpAddresses”: [“10.2.0.116”],“kubernetesProviderType”: “PROVIDER\_TYPE\_UNKNOWN”,“kubeletVersion”: “v1.28.6+k3s2”,“kubernetesLabels”: {“[kubernetes.io/hostname](http://kubernetes.io/hostname)”: “ip-10-2-0-116.us-east-2.compute.internal”,“[kubernetes.io/arch](http://kubernetes.io/arch)”: “amd64”,“[kubernetes.io/os](http://kubernetes.io/os)”: “linux”,“[beta.kubernetes.io/arch](http://beta.kubernetes.io/arch)”: “amd64”,“[beta.kubernetes.io/instance-type](http://beta.kubernetes.io/instance-type)”: “k3s”,“[beta.kubernetes.io/os](http://beta.kubernetes.io/os)”: “linux”,“[node-role.kubernetes.io/master](http://node-role.kubernetes.io/master)”: “true”,“[node-role.kubernetes.io/control-plane](http://node-role.kubernetes.io/control-plane)”: “true”,“[node.kubernetes.io/instance-type](http://node.kubernetes.io/instance-type)”: “k3s”},“kubernetesNodeUid”: “61174194-cbad-4e74-bfed-10d54f21280f”,“ipAddress”: [],“osArchitecture”: “X86”,“kubernetesNodeRoles”: [“control-plane”,“master”],“resourceCreationTimestamp”: 1709231820000,“osInfo”: “Red Hat Enterprise Linux 8.9 (Ootpa)”,“kubernetesNodeStates”: [“NODE\_STATE\_READY”],“osVersion”: “4.18.0-513.24.1.el8\_9.x86\_64”,“osType”: “LINUX”,“kubernetesNodeCordoned”: false,“kubernetesConditions”: [{“type”: “MemoryPressure”,“status”: “False”,“reason”: “KubeletHasSufficientMemory”,“message”: “kubelet has sufficient memory available”,“lastTransitionTimestamp”: 1709231820000},{“type”: “DiskPressure”,“status”: “False”,“reason”: “KubeletHasNoDiskPressure”,“message”: “kubelet has no disk pressure”,“lastTransitionTimestamp”: 1709231820000},{“type”: “PIDPressure”,“status”: “False”,“reason”: “KubeletHasSufficientPID”,“message”: “kubelet has sufficient PID available”,“lastTransitionTimestamp”: 1709231820000},{“type”: “Ready”,“status”: “True”,“reason”: “KubeletReady”,“message”: “kubelet is posting ready status”,“lastTransitionTimestamp”: 1713564532000}],“kubernetesAnnotations”: {“[flannel.alpha.coreos.com/kube-subnet-manager](http://flannel.alpha.coreos.com/kube-subnet-manager)”: “true”,“[flannel.alpha.coreos.com/public-ip](http://flannel.alpha.coreos.com/public-ip)”: “10.2.0.116”,“[flannel.alpha.coreos.com/backend-data](http://flannel.alpha.coreos.com/backend-data)”: “{\“VNI\”:1,\“VtepMAC\”:\“4a:d8:f9:b1:13:b5\”}”,“[k3s.io/node-env](http://k3s.io/node-env)”: “{\“K3S\_DATA\_DIR\”:\”/var/lib/rancher/k3s/data/13f9723ffde84ba41d08658d407a523bcf32698f179c9ab30cc0534e1e5d2c1a\“}”,“[alpha.kubernetes.io/provided-node-ip](http://alpha.kubernetes.io/provided-node-ip)”: “10.2.0.116”,“[csi.volume.kubernetes.io/nodeid](http://csi.volume.kubernetes.io/nodeid)”: “{\“[csi.oneagent.dynatrace.com](http://csi.oneagent.dynatrace.com)\”:\“ip-10-2-0-116.us-east-2.compute.internal\”}”,“[k3s.io/internal-ip](http://k3s.io/internal-ip)”: “10.2.0.116”,“[k3s.io/node-config-hash](http://k3s.io/node-config-hash)”: “BJHH2XQGHLYI42QVGO2SCCACG6GVKD3ZJOPRCC2BAMYZKNGH5ZRA====”,“[k3s.io/node-args](http://k3s.io/node-args)”: “[\“server\”,\”--write-kubeconfig-mode\“,\“644\”]”,“[node.alpha.kubernetes.io/ttl](http://node.alpha.kubernetes.io/ttl)”: “0”,“[volumes.kubernetes.io/controller-managed-attach-detach](http://volumes.kubernetes.io/controller-managed-attach-detach)”: “true”,“[k3s.io/hostname](http://k3s.io/hostname)”: “ip-10-2-0-116.us-east-2.compute.internal”,“[flannel.alpha.coreos.com/backend-type](http://flannel.alpha.coreos.com/backend-type)”: “vxlan”},“kubernetesNodeSystemUuid”: “ec2d527e-261a-3d17-96d6-5c792a6d9a61”},“tags”: [],“managementZones”: [],“fromRelationships”: {},“toRelationships”: {“isClusterOfNode”: [{“id”: “KUBERNETES\_CLUSTER-DFDB0908FE53A2C5”,“type”: “KUBERNETES\_CLUSTER”}],“runsOn”: [{“id”: “CLOUD\_APPLICATION\_INSTANCE-2C3937ABC0B41D2A”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-79F69884F8AAFB0E”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-9D35DD4552C5DC83”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-506D8FAC97BBE08E”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-125BFE8FFFC86409”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-E0E37E101508CCEE”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-FDC6DEE3AD5BBFE4”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-5FE59D4583F0A96B”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-1D02284EB35AC46A”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-B32BF387BA0C6D78”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-19F737A539EB610C”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-F978924A90C0138C”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-F74F861AB05E4CB5”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-841A8A74FDE79430”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-8AF32F066F9DE375”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-4C91BE3F109E384E”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-EE59E94601FCC08F”,“type”: “CLOUD\_APPLICATION\_INSTANCE”},{“id”: “CLOUD\_APPLICATION\_INSTANCE-1F0BA2D056DB1FAE”,“type”: “CLOUD\_APPLICATION\_INSTANCE”}],“isRuntimeComponentOf”: [{“id”: “RUNTIME\_COMPONENT-FCC80119E6ABADE6”,“type”: “RUNTIME\_COMPONENT”}]}}]}Thanks!

---

<div class="post-metadata">

**Author:** ![mark\_bley](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mark_bley/32/20954_2.png) [@mark\_bley](https://community.dynatrace.com/u/mark_bley)\
**Post date:** [May 15, 2024, 6:41pm UTC](https://community.dynatrace.com/t/what-is-the-correct-ip-address-of-kubernetes-node-coming-from-the-payload/45362/2 "2024-05-15T18:41:30Z")

</div>

You need to pass it in the entitySelector e.g.:

```markup
type(kubernetes_node),internalIpAddresses("10.1.0.2")
type(kubernetes_node),ipAddress("35.232.10.123")

```

Full example

```markup
curl -X 'GET' \
  'https://xxxxxxxx.dynatrace.com/api/v2/entities?entitySelector=type%28kubernetes_node%29%2CinternalIpAddresses%28%2210.1.0.2%22%29' \
  -H 'accept: application/json; charset=utf-8' \
  -H 'Authorization: Api-Token dt0c01.KWAU4Z77M7ZBIKIBRW6MZLIB.'

```
