[SOLVED] K3S (only master) gives the error: "couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request"

Hi all,
I installed a K3S master node (v 1.26.3+k3s1) with

curl -sfL https://get.k3s.io |INSTALL_K3S_EXEC="--disable traefik --disable local-storage --node-name hkm.int.h.net --node-ip 192.168.101.21 server --node-taint CriticalAddonsOnly=true:NoExecute" sh -

When I try to see the cluster info I get an E0406 error:

sysop@hdev:~/.kube$ kubectl cluster-info
E0406 10:16:14.156000    1794 memcache.go:287] couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0406 10:16:14.231443    1794 memcache.go:121] couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0406 10:16:14.233014    1794 memcache.go:121] couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0406 10:16:14.234844    1794 memcache.go:121] couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
Kubernetes control plane is running at https://hkm.int.h.net:6443
CoreDNS is running at https://hkm.int.h.net:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://hkm.int.h.net:6443/api/v1/namespaces/kube-system/services/https:metrics-server:https/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
sysop@hdev:~/.kube$

What can i do?

BTW when I installed K3S the last time (v1.24.3+k3s1) there was no error

I just had a similar issue. In my case it was caused by a firewall rule that blocked access to port 10250 which is used for scraping the metrics.

Check the logs of the metrics-server for any connection issues.

[SOLVED]

In the installation command I used the “–node-ip” value from another installation

The correct command is

curl -sfL https://get.k3s.io |INSTALL_K3S_EXEC="--disable traefik --disable local-storage --node-name hkm.int.h.net --node-ip 192.168.151.10 server --node-taint CriticalAddonsOnly=true:NoExecute" sh -

hi @MirtoBusico i got the same error now. Port 10250 is open & I installed K3S with --node-ip command. Can we open your case again?

Sorry I’m not able to replicate the error

With a master node with address 192.168.151.10 and the first worker node with address 192.168.151.11
I installed the master with

curl -sfL https://get.k3s.io |INSTALL_K3S_EXEC="--disable traefik --disable local-storage --node-name hkm.int.h.net --node-ip 192.168.151.10 server --node-taint CriticalAddonsOnly=true:NoExecute" sh -

And installed the first worker node with

sysop@hkw1:~$ echo $K3S_URL
https://192.168.151.10:6443
sysop@hkw1:~$ echo $K3S_TOKEN
K10b3f6f419ad6b45a232125447ac71cf8a6699e401664fd717cfd1fd21b686ebe4::server:1113397e8230f287bc9526dbbb66a630
sysop@hkw1:~$ curl -sfL https://get.k3s.io |INSTALL_K3S_EXEC="--node-name hkw1.int.h.net --node-ip 192.168.151.11" sh -

All went well and I don’t have any error

Hope this helps