Created
April 17, 2020 18:37
-
-
Save viggin543/c35fe1074cca0de7ad6fa7ec366a3470 to your computer and use it in GitHub Desktop.
call k8s metrics service directly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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