Kubernetes自动缩放和heapster问题

时间:2016-09-10 03:04:39

标签: kubernetes autoscaling heapster

我正在尝试在我的kubernetes集群中设置自动缩放。在部署heapster并为其提供服务之后。我正面临以下错误。

horizontal.go:99] Failed to reconcile nginx: failed to compute desired number of replicas based on CPU utilization for Deployment/default/nginx: failed to get CPU utilization: failed to get CPU consumption and request: failed to unmarshall heapster response: json: cannot unmarshal object into Go value of type []v1alpha1.PodMetrics
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: I0909 18:15:37.432445 27951 horizontal.go:403] Successfully updated status for nginx
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: }
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: ]
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: }
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: ]
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: }
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: }
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "memory": "1512Ki"
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "cpu": "0",
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "usage": {
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "name": "nginx",
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: {
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "containers": [
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "window": "1m0s",
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "timestamp": "2016-09-09T18:15:00Z",
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: },
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "creationTimestamp": "2016-09-09T18:15:37Z"
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "namespace": "default",
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "name": "nginx-24809263-3idn3",
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "metadata": {
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: {
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "items": [
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: "metadata": {},
Sep 09 18:15:37 dev1-132869446-3-157772786 kube-controller-manager[27951]: I0909 18:15:37.424164 27951 metrics_client.go:166] Heapster metrics result: {

Heapster成功从pod中提取指标,可在

上找到

http://master:8080/api/v1/proxy/namespaces/kube-system/services/heapster/apis/metrics/v1alpha1/namespaces/default/pods

{
"metadata": {},
"items": [
{
"metadata": {
"name": "nginx-24809263-3idn3",
"namespace": "default",
"creationTimestamp": "2016-09-10T02:57:03Z"
},
"timestamp": "2016-09-10T02:56:00Z",
"window": "1m0s",
"containers": [
{
"name": "nginx",
"usage": {
"cpu": "0",
"memory": "1400Ki"
}
}
]
}
]
}

我遇到了所有heapster版本的问题(heapster:canary,v1.2.0-beta.2,v1.1.0)

以下是有关我的环境的更多详细信息

Kubernetes版本 客户端版本:version.Info {Major:" 1",Minor:" 3",GitVersion:" v1.3.5",GitCommit:" b0deb2eb8f4037421077f77cb163dbb4c0a2a9f5& #34;,GitTreeState:" clean",BuildDate:" 2016-08-11T20:29:08Z",GoVersion:" go1.6.2",编译: " gc",平台:" linux / amd64"} 服务器版本:version.Info {Major:" 1",Minor:" 3",GitVersion:" v1.3.5",GitCommit:" b0deb2eb8f4037421077f77cb163dbb4c0a2a9f5& #34;,GitTreeState:" clean",BuildDate:" 2016-08-11T20:21:58Z",GoVersion:" go1.6.2",编译: " gc",平台:" linux / amd64"}

自定义/内部部署群集

操作系统(例如来自/ etc / os-release):NAME =" CentOS Linux"版本=" 7(核心)" 内核(例如uname -a):Linux dev1-132869446-3-157772786 3.10.0-327.13.1.el7.x86_64#1 SMP Thu Mar 31 16:04:38 UTC 2016 x86_64 x86_64 x86_64 GNU / Linux

<{3}}中的

建议无法解决问题

1 个答案:

答案 0 :(得分:1)

这是由于版本不匹配Kubernetes 1.3.5与Heapster v1.1.0-beta2一起使用