I have GCP cluster which contains GKE application:
I want to scale application using HPA
Based on supporting for metrics
HPA able to read metrics from
metrics.k8s.io (resource metrics)
custom.metrics.k8s.io(custom metrics)
external.metrics.k8s.io(external metrics)
How could I check what metrics available? How could try this API on my own ? Is it possible at all?
P.S.
Based on suggested answer I executed command:
kubectl get --raw https://MY-KUBE-APISERVER-IP:6443/apis/metrics.k8s.io/v1beta1/namespaces/default/pods
Response is:
{
"items": [
{
"metadata": {
"name": "prometheus-adapter-69fcdd56bc-2plh7",
"namespace": "default",
"selfLink": "/\r\napis/metrics.k8s.io/v1beta1/namespaces/default/pods/prometheus-adapter-69fcdd56bc-2plh7",
"creationTimestamp": "2020-02-05T10:56:02Z"
},
"timestamp": "2020-02-05T10:55:22Z",
"window": "30s",
"containers": [
{
"name": "prometheus-adapter",
"usage": {
"cpu": "15\r\n31939n",
"memory": "10408Ki"
}
}
]
},
{
"metadata": {
"name": "stackdriver-exporter-76fdbc9d8f-c285l",
"namespace": "default",
"selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/default/pods/stackdriver-exporter-76fdbc9d8f-c285l",
"creationTimestamp": "2020-0\r\n2-05T10:56:02Z"
},
"timestamp": "2020-02-05T10:55:22Z",
"window": "30s",
"containers": [
{
"name": "stackdriver-exporter",
"usage": {
"cpu": "79340n",
"memory": "2000Ki"
}
}
]
}
],
"kind": "PodMetricsList",
"apiVersion": "metrics.k8s.io/v1beta1",
"metadata": {
"selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/default/pods"
}
}
$ kubectl top pods
NAME CPU(cores) MEMORY(bytes)
prometheus-adapter-69fcdd56bc-2plh7 2m 10Mi
stackdriver-exporter-76fdbc9d8f-c285l 1m 1Mi
But I still don't see all metrics available for HPA