|
| 1 | +--- |
| 2 | +title: 集群自动扩缩容 |
| 3 | +linkTitle: 集群自动扩缩容 |
| 4 | +description: >- |
| 5 | + 自动管理集群中的节点以适配需求。 |
| 6 | +content_type: concept |
| 7 | +weight: 120 |
| 8 | +--- |
| 9 | +<!-- |
| 10 | +title: Cluster Autoscaling |
| 11 | +linkTitle: Cluster Autoscaling |
| 12 | +description: >- |
| 13 | + Automatically manage the nodes in your cluster to adapt to demand. |
| 14 | +content_type: concept |
| 15 | +weight: 120 |
| 16 | +--> |
| 17 | + |
| 18 | +<!-- overview --> |
| 19 | + |
| 20 | +<!-- |
| 21 | +Kubernetes requires {{< glossary_tooltip text="nodes" term_id="node" >}} in your cluster to |
| 22 | +run {{< glossary_tooltip text="pods" term_id="pod" >}}. This means providing capacity for |
| 23 | +the workload Pods and for Kubernetes itself. |
| 24 | +
|
| 25 | +You can adjust the amount of resources available in your cluster automatically: |
| 26 | +_node autoscaling_. You can either change the number of nodes, or change the capacity |
| 27 | +that nodes provide. The first approach is referred to as _horizontal scaling_, while the |
| 28 | +second is referred to as _vertical scaling_. |
| 29 | +
|
| 30 | +Kubernetes can even provide multidimensional automatic scaling for nodes. |
| 31 | +--> |
| 32 | +Kubernetes 需要集群中的{{< glossary_tooltip text="节点" term_id="node" >}}来运行 |
| 33 | +{{< glossary_tooltip text="Pod" term_id="pod" >}}。 |
| 34 | +这意味着需要为工作负载 Pod 以及 Kubernetes 本身提供容量。 |
| 35 | + |
| 36 | +你可以自动调整集群中可用的资源量:**节点自动扩缩容**。 |
| 37 | +你可以更改节点的数量,或者更改节点提供的容量。 |
| 38 | +第一种方法称为**水平扩缩容**,而第二种方法称为**垂直扩缩容**。 |
| 39 | + |
| 40 | +Kubernetes 甚至可以为节点提供多维度的自动扩缩容。 |
| 41 | + |
| 42 | +<!-- body --> |
| 43 | + |
| 44 | +<!-- |
| 45 | +## Manual node management |
| 46 | +
|
| 47 | +You can manually manage node-level capacity, where you configure a fixed amount of nodes; |
| 48 | +you can use this approach even if the provisioning (the process to set up, manage, and |
| 49 | +decommission) for these nodes is automated. |
| 50 | +
|
| 51 | +This page is about taking the next step, and automating management of the amount of |
| 52 | +node capacity (CPU, memory, and other node resources) available in your cluster. |
| 53 | +--> |
| 54 | +## 手动节点管理 {#manual-node-management} |
| 55 | + |
| 56 | +你可以手动管理节点级别的容量,例如你可以配置固定数量的节点; |
| 57 | +即使这些节点的制备(搭建、管理和停用过程)是自动化的,你也可以使用这种方法。 |
| 58 | + |
| 59 | +本文介绍的是下一步操作,即自动化管理集群中可用的节点容量(CPU、内存和其他节点资源)。 |
| 60 | + |
| 61 | +<!-- |
| 62 | +## Automatic horizontal scaling {#autoscaling-horizontal} |
| 63 | +
|
| 64 | +### Cluster Autoscaler |
| 65 | +
|
| 66 | +You can use the [Cluster Autoscaler](http://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) to manage the scale of your nodes automatically. |
| 67 | +The cluster autoscaler can integrate with a cloud provider, or with Kubernetes' |
| 68 | +[cluster API](http://github.com/kubernetes/autoscaler/blob/c6b754c359a8563050933a590f9a5dece823c836/cluster-autoscaler/cloudprovider/clusterapi/README.md), |
| 69 | +to achieve the actual node management that's needed. |
| 70 | +--> |
| 71 | +## 自动水平扩缩容 {#autoscaling-horizontal} |
| 72 | + |
| 73 | +### Cluster Autoscaler |
| 74 | + |
| 75 | +你可以使用 [Cluster Autoscaler](http://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) |
| 76 | +自动管理节点的数目规模。Cluster Autoscaler 可以与云驱动或 Kubernetes 的 |
| 77 | +[Cluster API](http://github.com/kubernetes/autoscaler/blob/c6b754c359a8563050933a590f9a5dece823c836/cluster-autoscaler/cloudprovider/clusterapi/README.md) |
| 78 | +集成,以完成实际所需的节点管理。 |
| 79 | + |
| 80 | +<!-- |
| 81 | +The cluster autoscaler adds nodes when there are unschedulable Pods, and |
| 82 | +removes nodes when those nodes are empty. |
| 83 | +
|
| 84 | +#### Cloud provider integrations {#cluster-autoscaler-providers} |
| 85 | +
|
| 86 | +The [README](http://github.com/kubernetes/autoscaler/tree/c6b754c359a8563050933a590f9a5dece823c836/cluster-autoscaler#readme) |
| 87 | +for the cluster autoscaler lists some of the cloud provider integrations |
| 88 | +that are available. |
| 89 | +--> |
| 90 | +当存在不可调度的 Pod 时,Cluster Autoscaler 会添加节点; |
| 91 | +当这些节点为空时,Cluster Autoscaler 会移除节点。 |
| 92 | + |
| 93 | +#### 云驱动集成组件 {#cluster-autoscaler-providers} |
| 94 | + |
| 95 | +Cluster Autoscaler 的 |
| 96 | +[README](http://github.com/kubernetes/autoscaler/tree/c6b754c359a8563050933a590f9a5dece823c836/cluster-autoscaler#readme) |
| 97 | +列举了一些可用的云驱动集成组件。 |
| 98 | + |
| 99 | +<!-- |
| 100 | +## Cost-aware multidimensional scaling {#autoscaling-multi-dimension} |
| 101 | +
|
| 102 | +### Karpenter {#autoscaler-karpenter} |
| 103 | +
|
| 104 | +[Karpenter](http://karpenter.sh/) supports direct node management, via |
| 105 | +plugins that integrate with specific cloud providers, and can manage nodes |
| 106 | +for you whilst optimizing for overall cost. |
| 107 | +--> |
| 108 | +## 成本感知多维度扩缩容 {#autoscaling-multi-dimension} |
| 109 | + |
| 110 | +### Karpenter {#autoscaler-karpenter} |
| 111 | + |
| 112 | +[Karpenter](http://karpenter.sh/) 支持通过继承了特定云驱动的插件来直接管理节点, |
| 113 | +还可以在优化总体成本的同时为你管理节点。 |
| 114 | + |
| 115 | +<!-- |
| 116 | +> Karpenter automatically launches just the right compute resources to |
| 117 | +> handle your cluster's applications. It is designed to let you take |
| 118 | +> full advantage of the cloud with fast and simple compute provisioning |
| 119 | +> for Kubernetes clusters. |
| 120 | +--> |
| 121 | +> Karpenter 自动启动适合你的集群应用的计算资源。 |
| 122 | +> Karpenter 设计为让你充分利用云资源,快速简单地为 Kubernetes 集群制备计算资源。 |
| 123 | +
|
| 124 | +<!-- |
| 125 | +The Karpenter tool is designed to integrate with a cloud provider that |
| 126 | +provides API-driven server management, and where the price information for |
| 127 | +available servers is also available via a web API. |
| 128 | +
|
| 129 | +For example, if you start some more Pods in your cluster, the Karpenter |
| 130 | +tool might buy a new node that is larger than one of the nodes you are |
| 131 | +already using, and then shut down an existing node once the new node |
| 132 | +is in service. |
| 133 | +--> |
| 134 | +Karpenter 工具设计为与云驱动集成,提供 API 驱动的服务器管理, |
| 135 | +此工具可以通过 Web API 获取可用服务器的价格信息。 |
| 136 | + |
| 137 | +例如,如果你在集群中启动更多 Pod,Karpenter 工具可能会购买一个比你当前使用的节点更大的新节点, |
| 138 | +然后在这个新节点投入使用后关闭现有的节点。 |
| 139 | + |
| 140 | +<!-- |
| 141 | +#### Cloud provider integrations {#karpenter-providers} |
| 142 | +--> |
| 143 | +#### 云驱动集成组件 {#karpenter-providers} |
| 144 | + |
| 145 | +{{% thirdparty-content vendor="true" %}} |
| 146 | + |
| 147 | +<!-- |
| 148 | +There are integrations available between Karpenter's core and the following |
| 149 | +cloud providers: |
| 150 | +
|
| 151 | +- [Amazon Web Services](http://github.com/aws/karpenter-provider-aws) |
| 152 | +- [Azure](http://github.com/Azure/karpenter-provider-azure) |
| 153 | +--> |
| 154 | +在 Karpenter 的核心与以下云驱动之间,存在可用的集成组件: |
| 155 | + |
| 156 | +- [Amazon Web Services](http://github.com/aws/karpenter-provider-aws) |
| 157 | +- [Azure](http://github.com/Azure/karpenter-provider-azure) |
| 158 | + |
| 159 | +<!-- |
| 160 | +## Related components |
| 161 | +
|
| 162 | +### Descheduler |
| 163 | +
|
| 164 | +The [descheduler](http://github.com/kubernetes-sigs/descheduler) can help you |
| 165 | +consolidate Pods onto a smaller number of nodes, to help with automatic scale down |
| 166 | +when the cluster has space capacity. |
| 167 | +--> |
| 168 | +## 相关组件 {#related-components} |
| 169 | + |
| 170 | +### Descheduler |
| 171 | + |
| 172 | +[Descheduler](http://github.com/kubernetes-sigs/descheduler) |
| 173 | +可以帮助你将 Pod 集中到少量节点上,以便在集群有空闲容量时帮助自动缩容。 |
| 174 | + |
| 175 | +<!-- |
| 176 | +### Sizing a workload based on cluster size |
| 177 | +
|
| 178 | +#### Cluster proportional autoscaler |
| 179 | +
|
| 180 | +For workloads that need to be scaled based on the size of the cluster (for example |
| 181 | +`cluster-dns` or other system components), you can use the |
| 182 | +[_Cluster Proportional Autoscaler_](http://github.com/kubernetes-sigs/cluster-proportional-autoscaler).<br /> |
| 183 | +
|
| 184 | +The Cluster Proportional Autoscaler watches the number of schedulable nodes |
| 185 | +and cores, and scales the number of replicas of the target workload accordingly. |
| 186 | +--> |
| 187 | +### 基于集群大小调整工作负载 {#sizing-a-workload-based-on-cluster-size} |
| 188 | + |
| 189 | +#### Cluster Proportional Autoscaler |
| 190 | + |
| 191 | +对于需要基于集群大小进行扩缩容的工作负载(例如 `cluster-dns` 或其他系统组件), |
| 192 | +你可以使用 [Cluster Proportional Autoscaler](http://github.com/kubernetes-sigs/cluster-proportional-autoscaler)。 |
| 193 | + |
| 194 | +Cluster Proportional Autoscaler 监视可调度节点和核心的数量,并相应地调整目标工作负载的副本数量。 |
| 195 | + |
| 196 | +<!-- |
| 197 | +#### Cluster proportional vertical autoscaler |
| 198 | +
|
| 199 | +If the number of replicas should stay the same, you can scale your workloads vertically according to the cluster size using |
| 200 | +the [_Cluster Proportional Vertical Autoscaler_](http://github.com/kubernetes-sigs/cluster-proportional-vertical-autoscaler). |
| 201 | +This project is in **beta** and can be found on GitHub. |
| 202 | +
|
| 203 | +While the Cluster Proportional Autoscaler scales the number of replicas of a workload, the Cluster Proportional Vertical Autoscaler |
| 204 | +adjusts the resource requests for a workload (for example a Deployment or DaemonSet) based on the number of nodes and/or cores |
| 205 | +in the cluster. |
| 206 | +--> |
| 207 | +#### Cluster Proportional Vertical Autoscaler |
| 208 | + |
| 209 | +如果副本数量应该保持不变,你可以使用 |
| 210 | +[Cluster Proportional Vertical Autoscaler](http://github.com/kubernetes-sigs/cluster-proportional-vertical-autoscaler) |
| 211 | +基于集群大小垂直扩缩你的工作负载。此项目处于 **Beta** 阶段,托管在 GitHub 上。 |
| 212 | + |
| 213 | +Cluster Proportional Autoscaler 扩缩工作负载的副本数量,而 Cluster Proportional Vertical Autoscaler |
| 214 | +基于集群中的节点和/或核心数量调整工作负载(例如 Deployment 或 DaemonSet)的资源请求。 |
| 215 | + |
| 216 | +## {{% heading "whatsnext" %}} |
| 217 | + |
| 218 | +<!-- |
| 219 | +- Read about [workload-level autoscaling](/docs/concepts/workloads/autoscaling/) |
| 220 | +--> |
| 221 | +- 参阅[工作负载级别自动扩缩容](/zh-cn/docs/concepts/workloads/autoscaling/) |
0 commit comments