请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

heapster失败:错误信息error: metrics not available yet

老师,在安装heapster时
kubectl get pods -n kube-system执行成果

NAME                                   READY     STATUS     RESTARTS   AGE
coredns-78fcdf6894-gxmvg               1/1       Running    0          22h
coredns-78fcdf6894-vthjl               1/1       Running    0          22h
etcd-k8s1                              1/1       Running    0          22h
heapster-86d674b4f7-px58f              1/1       Running    0          2h
kube-apiserver-k8s1                    1/1       Running    0          22h
kube-controller-manager-k8s1           1/1       Running    0          22h
kube-proxy-kjxsc                       1/1       Running    0          22h
kube-proxy-rhsz5                       1/1       Running    0          20h
kube-proxy-wtrdg                       1/1       NodeLost   0          21h
kube-scheduler-k8s1                    1/1       Running    0          22h
kubernetes-dashboard-767dc7d4d-jspl5   1/1       Running    0          17h
monitoring-grafana-5c948ff858-fcl8n    1/1       Running    0          2h
monitoring-influxdb-86584cb9b7-28tcc   1/1       Running    0          2h
weave-net-864xb                        2/2       Running    0          22h
weave-net-9tqln                        2/2       NodeLost   0          21h
weave-net-lq8rg                        2/2       Running    0          20h

执行kubectl create -f rbac/heapster-rbac.yaml成功

clusterrolebinding.rbac.authorization.k8s.io/heapster created

但是执行kubectl top node返回

error: metrics not available yet

同时发现在新开的ssh窗口执行:kubectl get pods -n kube-system,返回如下:

The connection to the server localhost:8080 was refused - did you specify the right host or port?

怀疑是dns有问题,请问应该如何查找问题,如何解决呢?

正在回答 回答被采纳积分+3

1回答

tonybai 2018-09-30 22:08:09

我想这里有两个问题:

1. metrics not available yet
- heapster安装后,需要等待一段时间才会有metrics数据进来。这之前都会返回"metrics not available yet"的提示信息

2. kubectl get pods命令失败
- 你可以看一下当前节点上的KUBECONFIG是否配置正确了。从你报错的日志来看,应该是没有正确配置KUBECONFIG,这样kubectl默认通过localhost:8080端口访问apiserver的insecure port

0 回复 有任何疑惑可以回复我~
  • 提问者 慕九州9557276 #1
    老师,
    1,我等待了3天kubectl top node仍然返回metrics not available yet
    2,我检查了了KUBECONFIG的server:配置是https://10.0.2.6:6443,应该改成8080端口吗
    回复 有任何疑惑可以回复我~ 2018-10-08 09:02:20
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信