Skip to content

Instantly share code, notes, and snippets.

@SaMnCo
Created February 23, 2018 11:37
Show Gist options
  • Save SaMnCo/243688abadd186b30219d57ca3050a39 to your computer and use it in GitHub Desktop.
Save SaMnCo/243688abadd186b30219d57ca3050a39 to your computer and use it in GitHub Desktop.
$ RANDOM_NODE=$(kubectl get nodes -o name | tail -n 1)
$ kubectl get --raw /apis/metrics.k8s.io/v1beta1/${RANDOM_NODE} | jq .
{
"kind": "NodeMetrics",
"apiVersion": "metrics.k8s.io/v1beta1",
"metadata": {
"name": "worker-n5-a6ayds",
"selfLink": "/apis/metrics.k8s.io/v1beta1/nodes/worker-n5-a6ayds",
"creationTimestamp": "2018-01-26T06:41:49Z"
},
"timestamp": "2018-01-26T06:41:00Z",
"window": "1m0s",
"usage": {
"cpu": "12436m",
"memory": "4991296Ki"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment