【问题标题】:Kubernetes horizontal pod autoscaling not workingKubernetes 水平 pod 自动缩放不起作用
【发布时间】:2016-04-05 16:47:51
【问题描述】:

kubectl version Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"5cb86ee022267586db386f62781338b0483733b3", GitTreeState:"clean"} Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"5cb86ee022267586db386f62781338b0483733b3", GitTreeState:"clean"}

控制器管理器上的错误日志: Failed to reconcile hello-world: failed to compute desired number of replicas based on CPU utilization for Deployment/default/hello-world: failed to get CPU utilization: failed to get CPU consumption and request: metrics obtained for 0/3 of pods

我可以直接与 Heapster 交谈并获取我的 pod 指标: curl http://$MY_HEAPSTER_SERVICE_IP:8082/api/v1/model/namespaces/default/pods//hello-world-819237062-j0ubt/metrics/cpu-usage

{
  "metrics": [
   {
    "timestamp": "2016-04-05T16:49:00Z",
    "value": 0
   },
   {
    "timestamp": "2016-04-05T16:48:00Z",
    "value": 0
   }
  ],
  "latestTimestamp": "2016-04-05T16:49:00Z"
 }

【问题讨论】:

  • 查看控制器管理器代码后,我能够找出导致此故障的原因。控制器管理器被硬编码以查找名称为“heapster”和“kube-system”命名空间中的 heapster 服务。我的服务未命名为 heapster,因此控制器管理器无法与之通信。

标签: kubernetes


【解决方案1】:

正如上面评论中所解释的,Heapster 在非默认位置运行,这是水平 pod 自动缩放控制器没有预料到的。

我打开了一个issue 以使其可配置。

【讨论】:

    猜你喜欢
    • 2022-10-04
    • 2021-02-22
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 2021-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多