Cannot install heapster to cluster due to kubelets not allowing to get metrics on port 10255

December 6, 2018 1.8k views
Kubernetes

We cannot install heapster to get better stats for our cluster, so we cannot use commands like kubectl top nodes for instance.

Heapster gives the following error:

Error in scraping containers from kubelet_summary:x.x.x.x:10255: Get http://x.x.x.x:10255/stats/summary/: dial tcp x.x.x.x:10255: getsockopt: connection refused

I think the kubelet has to have the --readonly-port=10255 option when starting it on the nodes.

3 Answers

Even tough heapster is deprecated, it's currently the only metrics service which works with kubernetes-dashboard.

I've got it working with a helm installment using the https kubelet port 10250 instead of the readonly http port 10255 - which is deprecated and not available on DO too

helm upgrade --install --wait k8s-heapster stable/heapster --set=command='{/heapster,--source=kubernetes:https://kubernetes.default?kubeletHttps=true&kubeletPort=10250&insecure=true}' --namespace kube-system

Or, in yaml:

command:
  - /heapster
  - --source=kubernetes:https://kubernetes.default?kubeletHttps=true&kubeletPort=10250&insecure=true

you have to use --kubelet-insecure-tls and --kubelet-preferred-address-types=InternalIP for connection refused issue.

Have another answer? Share your knowledge.