合作机构:阿里云 / 腾讯云 / 亚马逊云 / DreamHost / NameSilo / INWX / GODADDY / 百度统计
当集群资源不足时,Cluster Autoscaler会提供新节点并将其加入集群。使用Kubernetes时你可能会注意到,创建节点并将其加入集群的过程可能需要花费数分钟。在这段时间里,应用程序很容易被连接淹没,因为已经无法进一步扩展了。
虚拟机的配置可能需要花费数分钟,在这期间可能无法扩展应用
如何消除如此长的等待时间?
主动扩展(Proactive scaling),或者:
注意:本文涉及的所有代码都已发布至LearnK8s GitHub。
Linode可以支持这些解决方案。近期Lincode加入了 Akamai解决方案大家庭,现在注册Linode,就可免费获得价值100美元的使用额度,可以随意使用Linode云平台提供的各种服务。立即点击这里了解详情并注册吧↓↓↓
进一步了解Akamai Linode云计算服务与能力!
Cluster Autoscaler在触发自动扩展时并不检查内存或CPU的可用数,而是会对事件作出反应,检查所有不可调度的Pod。当调度器找不到能容纳某个Pod的节点时,我们就说这个Pod是不可调度的。
我们可以这样创建一个集群来测试看看。
bash
$ linode-cli lke cluster-create \
--label learnk8s \
--region eu-west \
--k8s_version 1.23 \
--node_pools.count 1 \
--node_pools.type g6-standard-2 \
--node_pools.autoscaler.enabled enabled \
--node_pools.autoscaler.max 10 \
--node_pools.autoscaler.min 1 \
$ linode-cli lke kubeconfig-view "insert cluster id here" --text | tail +2 | base64 -d > kubeconfig
TOP