Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes metrics-server: Error from server (ServiceUnavailable): the server is currently unable to handle the request

Tags:

kubernetes

executing the command kubectl get --raw /apis/metrics.k8s.io/v1beta1 it returned Error from server (ServiceUnavailable): the server is currently unable to handle the request

view the logs from metrics-server

http: TLS handshake error from 192.168.133.64:51926:EOF

kubelet version is 1.12.3

metrics-server 0.3.1

i have another clusters-set with the same version and configuration, metrics-server works just fine

part of metrics-server-deployment: containers: - name: metrics-server image: k8s.gcr.io/metrics-server-amd64:v0.3.1 imagePullPolicy: Always command: - /metrics-server - --kubelet-insecure-tls volumeMounts: - name: tmp-dir mountPath: /tmp

like image 600
Alan H0 Avatar asked Dec 28 '18 07:12

Alan H0


2 Answers

Looks like it is failing because the hostname resolution happens through the internal DNS system which have pods/service entries but not cluster node entries.

Try running your metrics-server with following arguments:

- command:
  - /metrics-server
  - --kubelet-insecure-tls
  - --kubelet-preferred-address-types=InternalIP

It should work for you as well.

For more info you can look at the following issue here

Hope this helps.

like image 105
Prafull Ladha Avatar answered Sep 28 '22 17:09

Prafull Ladha


Also worth pointing out that you should make sure metric-server is running

kubectl get pods -n kube-system | grep metrics-server
like image 29
louis_guitton Avatar answered Sep 28 '22 17:09

louis_guitton