metric-server : TLS handshake error from 20.99.219.64:57467: EOF

6/1/2020

I have deployed metric server using :

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml

Metric server pod is running but in logs I am getting error :

I0601 20:00:01.321004       1 log.go:172] http: TLS handshake error from 20.99.219.64:34903: EOF
I0601 20:00:01.321160       1 log.go:172] http: TLS handshake error from 20.99.219.64:22575: EOF
I0601 20:00:01.332318       1 log.go:172] http: TLS handshake error from 20.99.219.64:14603: EOF
I0601 20:00:01.333174       1 log.go:172] http: TLS handshake error from 20.99.219.64:22517: EOF
I0601 20:00:01.351649       1 log.go:172] http: TLS handshake error from 20.99.219.64:3598: EOF

IP : 20.99.219.64 This is not present in Cluster. I have checked using : kubectl get all --all-namespaces -o wide | grep "20.99.219.64" Nothing is coming as O/P.

I have using Calico and initialize the cluster with --pod-network-cidr=20.96.0.0/12

Also kubectl top nodes is not working, Getting error :

node@kubemaster:~/Desktop/dashboard$ kubectl top nodes
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)
-- Ankit Bansal
kubernetes

1 Answer

6/2/2020

During deployment of metrics-server remember to add following line in args section:

  - args:
    - --kubelet-insecure-tls
    - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname

Also add the following line at the spec:spec level outside of the previous containers level:

  hostNetwork: true
  restartPolicy: Always

Remember to apply changes.

Metrics-server attempts to authorize itself using token authentication. Please ensure that you're running your kubelets with webhook token authentication turned on.

Speaking about TLS directly. TLS message is big packet and MTU in calico is wrong so change it according calico-project-mtu.

Execute command:

$ kubectl edit configmap calico-config -n kube-system and change the MTU value from 1500 to 1430.

Take a look: metrics-server-mtu.

-- Malgorzata
Source: StackOverflow