简体   繁体   English

如何在GKE上扩展Kubernetes集群?

[英]How to scale a Kubernetes cluster on GKE?

I have a GKE cluster with n nodes (2 nodes with 1 CPU each in this example), running a stress test. 我有一个具有n个节点的GKE群集(在此示例中为2个节点,每个节点1个CPU),并运行压力测试。 I want them scaling without stopping running pods. 我希望他们在不停止运行Pod的情况下进行缩放。

The cluster has autoscale enabled and a node pool with autoscale enabled. 群集已启用自动缩放,并且节点池已启用自动缩放。

After reaching about 50 pods the memory/CPU ends up, and the cluster starts creating a new node in a different node pool. 达到约50个Pod后,内存/ CPU结束,群集开始在另一个节点池中创建一个新节点。 Why not in the current pool? 为什么不在当前池中?

After lanunching a new node the cluster crashes completely: 启动新节点后,集群完全崩溃:

  • no one node is running; 没有一个节点在运行;

  • some nodes are unschedulable with these warnings: 某些节点无法通过以下警告进行调度:

    "Cannot schedule pods: Insufficient memory." “无法安排Pod:内存不足。”

    "Cannot schedule pods: node(s) had taints that the pod didn't tolerate." “无法安排豆荚:节点有豆荚不能忍受的污点。” (I didn't set any taint though) (虽然我没有设置任何污点)

  • others are in Pending state. 其他处于待处理状态。

What I want to achieve: 我要实现的目标:

  • keep existing pods running without crashing; 保持现有吊舱运行而不会崩溃;
  • get the new pods created and kept in Pending state until the new node is created; 获取新的Pod,并将其保持为Pending状态,直到创建新节点为止;
  • the new node is created in the node pool with the instance template I have chosen. 将使用我选择的实例模板在节点池中创建新节点。

It sounds like the behavior you are seeing is part of the new node auto provisioning feature of the cluster autoscaler. 听起来您所看到的行为是群集自动缩放器的新节点自动配置功能的一部分。 It automatically manages a list of node pools on your behalf, which is why you are seeing a node pool created. 它代表您自动管理节点池列表,这就是为什么您看到创建的节点池的原因。

If you just want the existing node pool to scale up / down, you should disable node auto provisioning and just set the autoscaling parameters of your node pool (min / max number of nodes) to have the autoscaler add new nodes with the existing instance template. 如果仅希望现有节点池按比例放大/缩小,则应禁用节点自动配置,并设置节点池的自动缩放参数(最小/最大节点数)以使自动缩放器使用现有实例模板添加新节点。

I disabled the auto-provisioning and not the pool is scaling. 我禁用了自动配置功能,而不是扩展池。 But it keeps crashing all the pods while scaling. 但是在缩放时,它总是使所有Pod崩溃。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM