stefanprodan / k8s-prom-hpa

Kubernetes Horizontal Pod Autoscaler with Prometheus custom metrics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autoscale based on node metrics exposed to Prometheus by Node exporter

swatisehgal opened this issue · comments

I am trying to access the values of node metrics (exposed by node exporter to Prometheus) in custom metrics API which appear e.g. jobs.batch/node_memory_MemTotal. But when I do kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/batch.jobs/node_memory_MemTotal" | jq . I get Error from server (NotFound): the server could not find the requested resource

When I run kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1" | jq . I see the following metrics but am unable to access their values
{
"name": "jobs.batch/node_memory_MemTotal",
"singularName": "",
"namespaced": false,
"kind": "MetricValueList",
"verbs": [
"get"
]
},
{
"name": "jobs.batch/node_netstat_TcpExt_TCPHPHits",
"singularName": "",
"namespaced": false,
"kind": "MetricValueList",
"verbs": [
"get"
]
},
{
"name": "jobs.batch/node_netstat_TcpExt_TCPReqQFullDrop",
"singularName": "",
"namespaced": false,
"kind": "MetricValueList",
"verbs": [
"get"
]
},
{
"name": "jobs.batch/node_netstat_Icmp6_InEchoReplies",
"singularName": "",
"namespaced": false,
"kind": "MetricValueList",
"verbs": [
"get"
]
}

I referred to kubernetes-sigs/metrics-server#90 (comment) in the issue kubernetes-sigs/metrics-server#90 but wasn't able to access the metric values