kubernetes自动缩放有堆问题

时间:2018-11-19 09:37:46

标签: kubernetes

我在kubernetes上安装了heapster,我正在尝试自动缩放吊舱。.但我一直看到以下内容:

unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API: the server could not find the requested resource (get pods.metrics.k8s.io)

heapster服务本身

 I1009 14:22:21.014890       1 heapster.go:73] Heapster version v1.4.2
I1009 14:22:21.015226       1 configs.go:61] Using Kubernetes client with master "https://kubernetes.default" and version v1
I1009 14:22:21.015244       1 configs.go:62] Using kubelet port 10250
I1009 14:22:21.030070       1 heapster.go:196] Starting with Metric Sink
I1009 14:22:21.042806       1 heapster.go:106] Starting heapster on port 8082
E1009 14:30:05.000311       1 kubelet.go:280] Node ip-xxxxxx.eu-west-1.compute.internal is not ready
E1009 14:30:05.000342       1 kubelet.go:280] Node ip-xxxxxx.eu-west-1.compute.internal is not ready
E1009 14:30:05.000351       1 kubelet.go:280] Node ip-xxxxxx.eu-west-1.compute.internal is not ready
E1009 14:30:05.000357       1 kubelet.go:280] Node ip-xxxxxx.eu-west-1.compute.internal is not ready
E1009 14:30:05.000363       1 kubelet.go:280] Node ip-xxxxxx.eu-west-1.compute.internal is not ready
E1009 14:30:05.000370       1 kubelet.go:280] Node ip-xxxxxx.eu-west-1.compute.internal is not ready 

我想使用kubernetes进行自动缩放,任何人有任何想法吗?

我知道不推荐使用heapster,但是到目前为止,我无法更改或升级到指标服务器..所以可以提供一些帮助

1 个答案:

答案 0 :(得分:1)

我曾经见过类似的错误。问题是RBAC问题,但错误日志具有误导性。确保您已经为get资源提供了pods.metrics.k8s.io权限。

请检查以下类似问题:Kubernetes Custom CRD: “Failed to list …: the server could not find the requested resource”

  

注意:从Kubernetes 1.11开始,从Heapster获取度量标准为deprecated。参考:Horizontal Pod Autoscaler