0

我正在使用kubernetes 1.11.0和运行 heapster。当我跑

kubectl top pod

它会显示错误

Error from server (ServiceUnavailable): the server is currently unable to handle the request (get services http:heapster:)

虽然我已经安装了 heapster

kubectl create -f deploy/kube-config/influxdb/
kubectl create -f deploy/kube-config/rbac/heapster-rbac.yaml

有什么建议吗?

更新

该命令kubectl top pod现在有效,但端点不起作用

kubectl get --raw "/apis/metrics.k8s.io/v1beta1/pods"
#Error from server (ServiceUnavailable): the server is currently unable to handle the request
4

1 回答 1

3

你能检查并确保你的 kubectl 二进制文件是最新的吗?就像是

Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T22:29:25Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"darwin/amd64"} 如果 kubectl 较旧,通常会发生这种情况。旧的 kubectl 版本正在寻找heapster存在的服务,但新版本不应该有这个问题。希望这可以帮助。

除了上述之外,您可能还需要考虑迁移到指标服务器,因为 heapster 即将被弃用。

https://github.com/kubernetes/heapster/blob/master/docs/deprecation.md

于 2018-08-06T11:07:34.690 回答