Kubernetes HPA unable to fetch custom metrics from Prometheus Adapter
I am facing an issue with Kubernetes Horizontal Pod Autoscaler (HPA) which is unable to fetch custom metrics from the Prometheus Adapter. Despite following the configuration steps and verifying that metrics are available, the HPA reports no metrics.
HPA FailedGetPodsMetric
kubectl get –raw ‘/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/pods/*/app_request_count_per_second’| jq { “kind”: “MetricValueList”, “apiVersion”: “custom.metrics.k8s.io/v1beta1”, “metadata”: {}, “items”: [ { “describedObject”: { “kind”: “Pod”, “namespace”: “default”, “name”: “hello-pod”, “apiVersion”: “/v1” }, “metricName”: “app_request_count_per_second”, “timestamp”: “2024-05-29T08:38:20Z”, “value”: “5914m”, “selector”: null } ] } this is ready for custom.metrics.k8s.io api. And this is my hpa.yaml cat hpa.yaml apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: […]