Skip to content

Instantly share code, notes, and snippets.

@viggin543
Created April 17, 2020 18:37
Show Gist options
  • Save viggin543/c35fe1074cca0de7ad6fa7ec366a3470 to your computer and use it in GitHub Desktop.
Save viggin543/c35fe1074cca0de7ad6fa7ec366a3470 to your computer and use it in GitHub Desktop.
call k8s metrics service directly
kubectl get --raw /apis/metrics.k8s.io/v1beta1/namespaces/${NAMESPACE_NAME}/pods/${POD_NAME} | jq .
{
"kind": "PodMetrics",
"apiVersion": "metrics.k8s.io/v1beta1",
"metadata": {
"name": "PODNAME",
"namespace": "NAMESPACE",
"selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/NAMESPACE/pods/PODNAME",
"creationTimestamp": "2020-04-15T10:53:04Z"
},
"timestamp": "2020-04-15T10:52:34Z",
"window": "30s",
"containers": [
{
"name": "CONTAINER_NAME",
"usage": {
"cpu": "102527445n",
"memory": "62792Ki"
}
}
]
}
# this however also appears only after about minute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment