vcluster icon indicating copy to clipboard operation
vcluster copied to clipboard

Error on "metrics.k8s.io/v1beta1" in vcluster logs when metrics-server proxy enabled

Open yogeek opened this issue 1 year ago • 3 comments

What happened?

I enabled metrics-server proxy in vcluster options and also added the nodes sync to have correct RBAC:

proxy:
  metricsServer:
    nodes:
      enabled: true
    pods:
      enabled: true

sync:
  nodes:
    enabled: true

to be able to benefit from things like kubectl top pods and it seems to work but I have these errors in th vcluster pod logs :

W0118 08:54:34.532781       6 garbagecollector.go:752] failed to discover some groups: map[metrics.k8s.io/v1beta1:the server could not find the requested resource]
E0118 08:54:38.689951       6 resource_quota_controller.go:417] unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server could not find the requested resource

Once again, all seems to work fine as I can do the top command successfully)

What did you expect to happen?

I expected no error in the logs

How can we reproduce it (as minimally and precisely as possible)?

  • enable metrics-server proxy in vcluster conf
proxy:
  metricsServer:
    nodes:
      enabled: true
    pods:
      enabled: true

sync:
  nodes:
    enabled: true
  • look at the logs of the vcluster pod

Anything else we need to know?

In my host cluster, I do not have metrics-server installed, the APIservice for metrics is served by prometheus-adapter

$ k get apiservices.apiregistration.k8s.io| grep metrics
v1beta1.external.metrics.k8s.io        keda/keda-operator-metrics-apiserver   True        56d
v1beta1.metrics.k8s.io                 monitoring/prometheus-adapter          True        56d

$ k get apiservices.apiregistration.k8s.io | grep metrics                                                                                
v1beta1.metrics.k8s.io                 Local     True        4d23h

$ k api-resources | grep metrics
nodes   metrics.k8s.io/v1beta1     false        NodeMetrics
pods    metrics.k8s.io/v1beta1     true         PodMetrics

I do not know if it is relevant...

Host cluster Kubernetes version

$ kubectl version
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.13", GitCommit:"5244794d27b4cc68290bc496b00e248857ac8b47", GitTreeState:"clean", BuildDate:"2023-08-23T23:54:36Z", GoVersion:"go1.20.7", Compiler:"gc", Platform:"linux/amd64"}

Host cluster Kubernetes distribution

kubeadm

vlcuster version

$ vcluster --version
vcluster version 0.16.3

Vcluster Kubernetes distribution(k3s(default)), k8s, k0s)

v1.25.14+k3s1

OS and Arch

OS: Ubuntu
Arch: x86_64

yogeek avatar Jan 30 '24 09:01 yogeek

Update : just tested with the latest version of vcluster (0.18.1) and same result

yogeek avatar Jan 30 '24 10:01 yogeek

Have you seen this discussion on Slack? https://app.slack.com/client/TDSP6B7DY/C01N273CF4P

image

paalkr avatar Jan 31 '24 08:01 paalkr

@yogeek this should be solved with the upcoming v0.19

FabianKramm avatar Feb 07 '24 14:02 FabianKramm

Closing this issue for now, as it seems to be solved in the latest stable version. Please feel free to reopen it if you still face problems with it in 0.19

alexandradragodan avatar Feb 19 '24 12:02 alexandradragodan

I can confirm this is solved, thanks 👍

yogeek avatar Feb 20 '24 08:02 yogeek