Kubernetes Autoscaling无法识别Heapster [英] Kubernetes Autoscaling not recognizing Heapster
问题描述
我有一个kubernetes集群,我正尝试从头开始构建而不使用其构建脚本.除了自动缩放外,几乎所有东西都在工作.由于某种原因,控制管理器找不到或不知道heapster正在运行.
I have a kubernetes cluster that I'm trying to build from scratch without using their build scripts. Pretty much everything is working except for autoscaling. For some reason the control-manager can't find or doesn't know heapster is running.
我有一张罚单,但似乎没有任何回应
I have a ticket open but it seems no responses
https://github.com/kubernetes/kubernetes/issues/18652
更新:该问题已在Github上得到解决
UPDATE: the issue has been answered on Github
我已经设置好了.
这是当前所有豆荚的列表
Here is a list of all the pods currently
[root@kube-master test] [dev] # kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
default my-nginx-8kmlz 1/1 Running 0 11h
default my-nginx-z8cxb 1/1 Running 0 11h
kube-system heapster-v10-vdc1v 3/3 Running 0 11h
kube-system kube-apiserver-10.122.0.20 1/1 Running 0 4d
kube-system kube-controller-manager-10.122.0.20 1/1 Running 1 9h
kube-system kube-dns-6iw3a 4/4 Running 0 4d
kube-system kube-proxy-10.122.0.20 1/1 Running 0 3d
kube-system kube-proxy-10.122.42.163 1/1 Running 0 4d
kube-system kube-proxy-10.122.43.138 1/1 Running 1 4d
kube-system kube-scheduler-10.122.0.20 1/1 Running 1 4d
因此,heapster正在针对我的代理运行,我可以访问
So heapster is running against my proxy and I can access
http://10.122.0.20:8080/api/v1/proxy/namespaces/kube-system/services/heapster/api/v1/model/namespaces/default/pods/my-nginx-8kmlz/stats
它返回有关广告连播的统计信息.
It returns stats about the pod.
我真的不确定我缺少什么.
I'm really not sure what i am missing.
这是自动缩放的输出结果
Here is what the output of a autoscale looks like
[root@kube-master test] [dev] # kubectl get hpa
NAME REFERENCE TARGET CURRENT MINPODS MAXPODS AGE
my-nginx ReplicationController/my-nginx/scale 80% <waiting> 1 5 22h
我的控制器日志中唯一真正看到的是
In my controller logs the only thing I really see is
W1224 18:27:43.425126 1 horizontal.go:185] Failed to reconcile my-nginx: failed to compute desired number of replicas based on CPU utilization for ReplicationController/default/my-nginx: failed to get cpu utilization: failed to get CPU consumption and request: some pods do not have request for cpu
推荐答案
有时会发生这种情况,因为未启用资源指标.
Some time this happen because resource metrics not enabled.
您可以使用blow
命令进行验证:
you can verify with blow
command:
kubectl top pod -n <namespace>
如果要获取广告连播,则会启用指标:
if you are getting pods then metrics is enabled:
这篇关于Kubernetes Autoscaling无法识别Heapster的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!