metrics-server: how to run metrics-server when apiserver does not have access to pods or services network

How to run metrics-server in the case where apiserver runs in a separate machine (with systemd for example) and does not have access to cluster network ? Because in this case apiserver tries to reach the metrics-server svc but it can not.

logs of apiserver

available_controller.go:353] v1beta1.metrics.k8s.io failed with: Get https://10.32.0.169:443: dial tcp 10.32.0.169:443: connect: no route to host

where 10.32.0.169 is the IP of metrics-server svc

$ kubectl -n kube-system get svc -l kubernetes.io/name=Metrics-server
NAME             TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)   AGE
metrics-server   ClusterIP   10.32.0.169   <none>        443/TCP   15m

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 6
  • Comments: 17 (3 by maintainers)

Most upvoted comments

I read a bit on the first link you gave there and found this:

If you are not running kube-proxy on a host running the API server, then you must make sure that the system is enabled with the following kube-apiserver flag:

–enable-aggregator-routing=true

That together with hostNetwork should probably do the trick. Let me try that!

Update: It did the trick. 😃 Thanks for the help, @serathius.