【问题标题】:Kubernetes 1.11 could not find heapster for metricsKubernetes 1.11 找不到指标的 heapster
【发布时间】:2018-10-17 17:08:07
【问题描述】:

我在 Digital Ocean 上使用 Kubernetes 1.11,当我尝试使用 kubectl 顶级节点时出现此错误:

Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)

但正如文档中所述,heapster 已被弃用,kubernetes 1.10 不再需要

【问题讨论】:

标签: kubernetes metrics kubectl sys sysadmin


【解决方案1】:

如果您正在运行更新版本的 Kubernetes 并且仍然收到此错误,则可能是您的安装存在问题。

请注意,要在 kubernetes 上安装指标服务器,您应该首先通过键入以下内容来克隆它:

git clone https://github.com/kodekloudhub/kubernetes-metrics-server.git

那么您应该安装它,无需进入创建的文件夹,也无需提及特定的 YAML 文件,仅通过:

kubectl create -f kubernetes-metrics-server/

这样所有服务和组件都安装正确,就可以运行了:

kubectl top nodes

kubectl top pods

并得到正确的结果。

【讨论】:

    【解决方案2】:

    要使kubectl top node/pod 正常工作,您需要在集群上安装heapstermetrics server

    正如警告所说:heapster 已被弃用,因此现在推荐的选择是 metrics 服务器

    所以按照here 的指示安装指标服务器

    【讨论】:

    • 我在集群的 kube-system 命名空间中安装了 metrics-server,但仍然遇到同样的错误。如果我做 kubectl logs kubectl logs metrics-server-85dc785fbf-76qf9 我得到这个输出E1018 12:10:51.797774 1 manager.go:102] unable to fully collect metrics: [unable to fully scrape metrics from source kubelet_summary:nostalgic-pare-gt8: unable to fetch metrics from Kubelet nostalgic-pare-gt8 (nostalgic-pare-gt8): Get https://nostalgic-pare-gt8:10250/stats/summary/: dial tcp: lookup nostalgic-pare-gt8 on 10.245.0.10:53: no such host
    • @FakeAccount 将此参数用于度量服务器:--kubelet-preferred-address-types=InternalIP,Hostname,InternalDNS,ExternalIP,ExternalDNS
    • 我还有 kube-state-metrics 我得到 admin@ip-172-21-59-122:~$ kubectl top nodes 服务器错误(未找到):服务器找不到请求的资源(获取服务 http:heapster:) admin@ip-172-21-59-122:~$ kubectl top nodes -n kube-system 服务器错误 (NotFound): 服务器找不到请求的资源 (获取服务 http:堆:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-27
    • 2020-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-04
    • 2023-03-29
    相关资源
    最近更新 更多