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.