2

I am getting below error after installing keda in my k8s cluster and created some scaled object...

whatever command i am running EG: " kubectl get pods" i am getting response with below error message..

How to get rid of below error message.

E0125 11:45:32.766448 316 memcache.go:255] couldn't get resource list for external.metrics.k8s.io/v1beta1: Got empty response for: external.metrics.k8s.io/v1beta1

  • It is a recent known issue. You can follow these 2 links to get updates on the problem [KEDA issue](https://github.com/kedacore/keda/issues/4008) - [custom-metrics-apiserver issue](https://github.com/kubernetes-sigs/custom-metrics-apiserver/issues/146) – Karots96 Jan 30 '23 at 09:43

1 Answers1

5

This error is from client-go when there are no resources available in external.metrics.k8s.io/v1beta1 here in client-go, it gets all ServerGroups. When KEDA is not installed then external.metrics.k8s.io/v1beta1 is not part of ServerGroups and hence its not called and therefore no issue.

But when KEDA is installed then it creates an ApiService

$ kubectl get apiservice | grep keda-metrics
v1beta1.external.metrics.k8s.io        keda/keda-metrics-apiserver   True        20m

But it doesn't create any external.metrics.k8s.io resources

$ kubectl get --raw /apis/external.metrics.k8s.io/v1beta1 | jq .
{
  "kind": "APIResourceList",
  "apiVersion": "v1",
  "groupVersion": "external.metrics.k8s.io/v1beta1",
  "resources": []
}

Since there are no resources, client-go throws an error.

The workaround is registering a dummy resource in the empty resource group.

Refer to this Github link for more detailed information.

Fariya Rahmat
  • 2,123
  • 3
  • 11
  • 2
    Can you please provide an example on how to register a dummy resource so we can at least hide these errors? – zachbugay Mar 09 '23 at 15:27