I have a k8s on AWS (EKS). I'm using prometheus-adapter
to expose custom metrics
and external metrics
for HPA (HorizontalPodAutoscaler). I'm using Helm to install prometheus-adapter
(Chart version 4.9.0).
I'm trying to fetch the value for my external metrics but failing to do so.
I can see that the metrics is there:
kubectl get --raw '/apis/external.metrics.k8s.io/v1beta1' | jq .
outputs:
{
"kind": "APIResourceList",
"apiVersion": "v1",
"groupVersion": "external.metrics.k8s.io/v1beta1",
"resources": [
{
"name": "some_dummy_sqs_01",
"singularName": "",
"namespaced": true,
"kind": "ExternalMetricValueList",
"verbs": [
"get"
]
}
]
}
I have tried with the following paths, with no luck:
/apis/external.metrics.k8s.io/v1beta1/some_dummy_sqs_01
->Error from server (NotFound): the server could not find the requested resource
/apis/external.metrics.k8s.io/v1beta1/namespaces/some_dummy_sqs_01
->Error from server (NotFound): the server could not find the requested resource
/apis/external.metrics.k8s.io/v1beta1/namespaces//some_dummy_sqs_01
->Error from server (InternalError): Internal error occurred: unable to fetch metrics
/apis/external.metrics.k8s.io/v1beta1/namespaces/*/some_dummy_sqs_01
->Error from server (InternalError): Internal error occurred: unable to fetch metrics
/apis/external.metrics.k8s.io/v1beta1/namespaces/prometheus/some_dummy_sqs_01
->Error from server (InternalError): Internal error occurred: unable to fetch metrics
prometheus-adapter
configuration looks like this:
# prom-adapter-values.yaml
prometheus:
url: http://prometheus-server
port: 80
rules:
default: false
external:
- seriesQuery: 'sqs_approximatenumberofmessages{queue!="",namespace!=""}'
resources:
namespaced: false
name:
matches: ""
as: "some_dummy_sqs_01"
metricsQuery: 'sum(rate(<<.Series>>[1m]) by (queue)'