I am using Stackdriver Monitoring API to get the metrics related to the containers. The JSON object returned from the API has the following details of the container.
Example:
{
"metric": {
"type": "container.googleapis.com/container/cpu/utilization"
},
"resource": {
"type": "gke_container",
"labels": {
"zone": "us-central1-a",
"pod_id": "1138528c-c36e-11e9-a1a7-42010a800198",
"project_id": "auto-scaling-springboot",
"cluster_name": "load-test",
"container_name": "",
"namespace_id": "f0965889-c36d-11e9-9e00-42010a800198",
"instance_id": "3962380509873542383"
}
},
"metricKind": "GAUGE",
"valueType": "DOUBLE",
"points": [
{
"interval": {
"startTime": "2019-09-04T04:00:00Z",
"endTime": "2019-09-04T04:00:00Z"
},
"value": {
"doubleValue": 0.050707947222229495
}
}
]
}
When I execute kubectl describe pod [pod name]
, I get none of these information unique to a container. Therefore I am unable to identify the results corresponding to a container.
Therfore, how to I get the pod ID so that I'll be able to identify it?