executing the command kubectl top nodes, seems it's freezed
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
192.168.133.64 is the internal ip address of api-server
from api-server log
E1214 02:06:35.625504 1 memcache.go:134] couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E1214 02:07:05.573958 1 available_controller.go:311] v1beta1.metrics.k8s.io failed with: Get https://10.109.179.236:443: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
E1214 02:07:05.658841 1 memcache.go:134] couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
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
api-server parameters
```
Have you solved the problem?
Have you seen log that metrics-server successfully generated certificate?
I had cases when it could take 2-3 minutes for metrics server to be able to serve tls.
no, it still gives the same errors
any other places that i can check
I would increase verbosity in metrics-server and try to find something in logs
Has someone solved the problem?
just keep having such logs
I1220 09:39:33.000928 1 logs.go:49] http: TLS handshake error from 192.168.133.64:45734: EOF
I1220 09:40:02.985989 1 logs.go:49] http: TLS handshake error from 192.168.133.64:45794: EOF
I1220 09:40:10.416586 1 manager.go:95] Scraping metrics from 5 sources
I1220 09:40:10.419951 1 manager.go:120] Querying source: kubelet_summary:k83.xxxx.xxx
I1220 09:40:10.424855 1 manager.go:120] Querying source: kubelet_summary:k82.xxxx.xxx
I1220 09:40:10.427763 1 manager.go:120] Querying source: kubelet_summary:k84.xxxx.xxx
I1220 09:40:10.435885 1 manager.go:120] Querying source: kubelet_summary:k85.xxxx.xxx
I1220 09:40:10.446844 1 manager.go:120] Querying source: kubelet_summary:k81.xxxx.xxx
I1220 09:40:16.078000 1 manager.go:150] ScrapeMetrics: time: 5.661316126s, nodes: 5, pods: 46
containers:
command:
- /metrics-server
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalIP
volumeMounts:
- name: tmp-dir
mountPath: /tmp
thanks, turned out it's MTU issue
from calico config, it was 1500 while the interface is 1450
finally kubectl edit configmap calico-config -n kube-system and change the MTU value from 1500 to 1430
you can add this
command:
- /metrics-server
- --metric-resolution=30s
- --requestheader-allowed-names=aggregator
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP
it will work
to reinstall the metrics-server again;
follow the way,i had sovle the error.
InternalIP need view localhost ip ?
my yaml
apiVersion: v1
kind: Pod
metadata:
name: cpu-demo
namespace: cpu-example
spec:
containers:
- name: cpu-demo-ctr
image: vish/stress
resources:
limits:
cpu: "1"
requests:
cpu: "0.5"
args:
- -cpus
- "2"
i input node command:
kubectl apply -f cpu-request-limit.yaml
then
kubectl top pod cpu-demo --namespace=cpu-example
but Errors:
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)
Adding hostNetwork: true in the spec fixed my issue !
hostNetwork:
enabled: true
Duplicate of #157
@aneesh121 you save 2 days. Thanks!
Anyone provision the cluster with kubeadm, please start by checking the answer https://github.com/kubernetes-sigs/metrics-server/issues/188#issuecomment-586673541
For EKS users, it requires only args: - --kubelet-preferred-address-types=InternalIP as I explained here
Adding hostNetwork: true in the spec fixed my issue !
hostNetwork: enabled: trueDuplicate of #157
This is the solution only when the metrics-server runs on EKS.
original
added --kubelet-insecure-tls
kubectl create -f https://raw.githubusercontent.com/x1wins/CW-OVP/master/k8s-manifests/components.yaml
Most helpful comment
try to edit the metrics-server-deployment.yaml file and add command parameters :