GKE群集自动缩放器配置文件可提供较旧的光泽 [英] GKE Cluster autoscaler profile for older luster

查看:82
本文介绍了GKE群集自动缩放器配置文件可提供较旧的光泽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,在GKE中,在创建新的K8s集群时有一个新的标签

Now in GKE there is new tab while creating new K8s cluster

Automation-为自动维护,自动扩展和自动设置设置群集级别标准.编辑节点池以实现自动扩展,自动升级和修复之类的自动化.

Automation - Set cluster-level criteria for automatic maintenance, autoscaling, and auto-provisioning. Edit the node pool for automation like auto-scaling, auto-upgrades, and repair.

它有两个选项- Balanced(默认)& 优化利用率(测试版)

it has two options - Balanced (default) & Optimize utilization (beta)

不能为旧群集设置此设置吗?

cant we set this for older cluster any work around?

我们正在运行旧版GKE 1.14 ,我们希望在现有节点的资源利用率 70%时自动扩展集群.

we are running old GKE version 1.14 we want to auto-scale cluster when 70% of resource utilization of existing nodes.

当前,我们有 2 个不同的池-只有一个启用了自动节点配置,但是在高峰时段,如果HPA扩展了POD,则新节点需要一些时间才能加入集群有时退出节点由于资源压力而开始崩溃.

Currently, we have 2 different pools - only one has auto node provisioning enable but during peak hour if HPA scales POD, New node taking some time to join the cluster and sometimes exiting node start crashing due to resource pressure.

推荐答案

您可以通过以下步骤设置自动缩放配置文件:

You can set the autoscaling profile by going into:

  • GCP Cloud Console(Web UI)-> Kubernetes Engine-> CLUSTER-NAME-> Edit-> Autoscaling profile
  • GCP Cloud Console (Web UI) -> Kubernetes Engine -> CLUSTER-NAME -> Edit -> Autoscaling profile

此屏幕截图是在GKE版本1.14.10-gke.50

您还可以运行:

  • gcloud beta container clusters update CLUSTER-NAME --autoscaling-profile optimize-utilization

官方文档指出:

您可以指定在做出此类决定时要使用的自动缩放配置文件.当前可用的配置文件为:

You can specify which autoscaling profile to use when making such decisions. The currently available profiles are:

  • balanced:默认配置文件.
  • optimize-utilization:与在群集中保留备用资源相比,优先考虑优化利用率.选择该选项后,群集自动缩放器会更主动地按比例缩小群集:它可以删除更多节点,并更快地删除节点. 此配置文件已经过优化,可用于对启动延迟不敏感的批处理工作负载.我们目前不建议将此配置文件用于服务工作负载.
  • balanced: The default profile.
  • optimize-utilization: Prioritize optimizing utilization over keeping spare resources in the cluster. When selected, the cluster autoscaler scales down the cluster more aggressively: it can remove more nodes, and remove nodes faster. This profile has been optimized for use with batch workloads that are not sensitive to start-up latency. We do not currently recommend using this profile with serving workloads.

- Cloud.google.com: Kubernetes Engine:群集自动缩放器:自动缩放配置文件

将此设置(optimize-utilization)用于服务工作负载时,不是最佳选择.它将更加积极地尝试scale-down(删除节点).它将自动减少群集拥有的可用资源数量,并且可能更容易受到工作负载高峰的影响.

This setting (optimize-utilization) could not be the best option when using it for serving workloads. It will more aggressively try to scale-down (remove a node). It will automatically reduce the amount of available resources your cluster is having and could be more vulnerable to workload spikes.

回答问题的一部分:

我们正在运行旧版GKE 1.14,我们希望在现有节点的资源利用率达到70%时自动扩展集群.

we are running old GKE version 1.14 we want to auto-scale cluster when 70% of resource utilization of existing nodes.

如文档中所述:

集群自动缩放器根据在该节点池的节点上运行的Pod的资源请求(而不是实际资源利用率)自动增加或减小节点池的大小.它会定期检查Pod和节点的状态,并采取措施:

Cluster autoscaler increases or decreases the size of the node pool automatically, based on the resource requests (rather than actual resource utilization) of Pods running on that node pool's nodes. It periodically checks the status of Pods and nodes, and takes action:

  • 如果由于节点池中没有足够的节点而无法调度Pod,则群集自动缩放器会添加节点,最多达到节点池的最大大小.

- Cloud.google.com: Kubernetes Engine:群集自动缩放器:群集自动缩放器如何工作

您不能基于资源利用率的百分比(70%)直接扩展集群. Autoscaler基于群集无法在当前现有节点上调度Pod的功能.

You can't directly scale the cluster based on the percentage of resource utilization (70%). Autoscaler bases on inability of the cluster to schedule pods on currently existing nodes.

您可以使用

You can scale the amount of replicas of your Deployment by CPU usage with Horizontal Pod Autoscaler. This Pods could have a buffer to handle increased amount of traffic and after a specific threshold they could spawn new Pods where the CA( Cluster autoscaler) would send a request for a new node (if new Pods are unschedulable). This buffer would be the mechanism to prevent sudden spikes that application couldn't manage.

缓冲区部分和预留空间的详细说明:

The buffer part and over-provisioning explained in details in:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆