cluster-autoscaler不会扩展kubernetes集群

时间:2017-03-22 07:35:22

标签: amazon-web-services kubernetes

我在k8skops创建了一个aws群集,节点自动缩放组配置如下:

metadata:
creationTimestamp: "2017-03-21T03:53:26Z"
name: nodes
spec:
  associatePublicIp: true
  image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
  machineType: t2.medium
  maxSize: 5
  minSize: 2
  role: Node
  zones:
  - us-west-1a
  - us-west-1c

aws控制台显示当前的asg:

desired:2; min:2; max:5

然后我使用official doc安装add-ons --- cluster-autoscaler,然后我部署了当前群集无法提供资源的pod,但是{{1没有将节点添加到集群中,日志如下所示:

cluster-autoscaler

那么为什么admin@ip-10-0-52-252:/var/log$kubectl logs -f cluster-autoscaler-1581749901-fqbzk -n kube-system I0322 07:08:43.407683 1 event.go:216] Event(api.ObjectReference{Kind:"Pod", Namespace:"default", Name:"new-mq-test-951523717-trd2s", UID:"9437ac54-0ecd-11e7-8779-0257a5d4c012", APIVersion:"v1", ResourceVersion:"189546", FieldPath:""}): type: 'Normal' reason: 'NotTriggerScaleUp' pod didn't trigger scale-up (it wouldn't fit if a new node is added) I0322 07:08:43.407910 1 event.go:216] Event(api.ObjectReference{Kind:"Pod", Namespace:"default", Name:"new-mq-test-951523717-n986l", UID:"9437a3db-0ecd-11e7-8779-0257a5d4c012", APIVersion:"v1", ResourceVersion:"189543", FieldPath:""}): type: 'Normal' reason: 'NotTriggerScaleUp' pod didn't trigger scale-up (it wouldn't fit if a new node is added) 不会通过添加ec2节点来扩展群集?任何答案都非常感谢

2 个答案:

答案 0 :(得分:1)

最后我找到了答案,kops asg的默认nodes配置为t2.medium,而我部署了需要5000M内存的pod,就像我们所有人一样konw t2.medium内存为4GB,不符合要求,因此cluster-autoscaler无法扩展!

答案 1 :(得分:0)

我尝试在Google Container Engine上使用Kubernetes自动缩放时遇到了类似的问题。当您的群集中没有足够的节点来容纳Kubernetes pod 时,通常会发生这种情况。

解决方案是在群集中启用自动扩展(在您的情况下为AWS EC2)以及kubernetes自动扩展。

在AWS上查看以下有关自动缩放的Kubernetes文档,以获取更多信息:link