Skip to content

Commit

Permalink
update create-hpa to fix issue #6075 (#6112)
Browse files Browse the repository at this point in the history
  • Loading branch information
windsonsea authored Jan 9, 2025
1 parent fa655ef commit c82baff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
26 changes: 14 additions & 12 deletions docs/en/docs/kpanda/user-guide/scale/create-hpa.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Create HPA

DaoCloud Enterprise 5.0 supports elastic scaling of Pod resources based on metrics (Horizontal Pod Autoscaling, HPA).
DaoCloud Enterprise 5.0 supports scaling of Pod resources based on metrics (Horizontal Pod Autoscaling, HPA).
Users can dynamically adjust the number of copies of Pod resources by setting CPU utilization, memory usage, and custom metrics.
For example, after setting an auto scaling policy based on the CPU utilization metric for the workload,
when the CPU utilization of the Pod exceeds/belows the metric threshold you set, the workload controller
Expand All @@ -12,11 +12,11 @@ This page describes how to configure auto scaling based on built-in metrics and

1. HPA is only applicable to Deployment and StatefulSet, and only one HPA can be created per workload.
2. If you create an HPA policy based on CPU utilization, you must set the configuration limit (Limit) for the workload in advance, otherwise the CPU utilization cannot be calculated.
3. If built-in metrics and multiple custom metrics are used at the same time, HPA will calculate the number of scaling copies required based on multiple metrics, and take the larger value (but not exceed the maximum number of copies configured when setting the HPA policy) for elastic scaling .
3. If built-in metrics and multiple custom metrics are used at the same time, HPA will calculate the number of scaling copies required based on multiple metrics, and take the larger value (but not exceed the maximum number of copies configured when setting the HPA policy) for scaling .

## Built-in metric elastic scaling policy
## Built-in metric scaling policy

The system has two built-in elastic scaling metrics of CPU and memory to meet users' basic business cases.
The system has two built-in scaling metrics of CPU and memory to meet users' basic business cases.

### Prerequisites

Expand Down Expand Up @@ -56,13 +56,15 @@ Refer to the following steps to configure the built-in index auto scaling policy

5. Create custom metric auto scaling policy parameters.


- Policy name: Enter the name of the auto scaling policy. Please note that the name can contain up to 63 characters, and can only contain lowercase letters, numbers, and separators ("-"), and must start and end with lowercase letters or numbers, such as hpa- my-dep.
- Namespace: The namespace where the payload resides.
- Workload: The workload object that performs auto scaling.
- Target CPU Utilization: The CPU usage of the Pod under the workload resource. The calculation method is: the request (request) value of all Pod resources/workloads under the workload. When the actual CPU usage is greater/lower than the target value, the system automatically reduces/increases the number of Pod replicas.
- Target Memory Usage: The memory usage of the Pod under the workload resource. When the actual memory usage is greater/lower than the target value, the system automatically reduces/increases the number of Pod replicas.
- Replica range: the elastic scaling range of the number of Pod replicas. The default interval is 1 - 10.
- Policy Name: Enter the name of the scaling policy. Please note that the name can be up to 63 characters long and can only contain lowercase letters, numbers, and separators ("-"). It must also start and end with a lowercase letter or number, for example, hpa-my-dep.
- Namespace: The namespace where the load is located.
- Workload: The workload object that executes scaling.
- Replica Range: Set the minimum number of container group replicas allowed, with a default value of 1. Set the maximum number of container group replicas allowed, with a default value of 10.
- Stabilization Time Window: The stabilization window time for scaling up and down must be greater than or equal to 0 and less than or equal to 3600, with a range of [0, 3600] seconds.
- System Metrics:
- CPU Utilization: The CPU usage of the Pods under the workload resources. The calculation method is: total resources of all Pods under the workload / request value of the workload. When the actual CPU usage is greater than/less than the target value, the system automatically decreases/increases the number of Pod replicas.
- Memory Usage: The memory usage of the Pods under the workload resources. When the actual memory usage is greater than/less than the target value, the system automatically decreases/increases the number of Pod replicas.
- Custom Metrics: Refer to [Creating HPA Based on Custom Metrics](./custom-hpa.md).

6. After completing the parameter configuration, click the __OK__ button to automatically return to the elastic scaling details page. Click ____ on the right side of the list to edit, delete, and view related events.
6. After completing the parameter configuration, click the __OK__ button to automatically return to the scaling details page. Click ____ on the right side of the list to edit, delete, and view related events.
Binary file added docs/zh/docs/kpanda/images/createScale08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions docs/zh/docs/kpanda/user-guide/scale/create-hpa.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ DaoCloud Enterprise 5.0 支持 Pod 资源基于指标进行弹性伸缩(Horizo
- 策略名称:输入弹性伸缩策略的名称,请注意名称最长 63 个字符,只能包含小写字母、数字及分隔符(“-”),且必须以小写字母或数字开头及结尾,例如 hpa-my-dep。
- 命名空间:负载所在的命名空间。
- 工作负载:执行弹性伸缩的工作负载对象。
- 目标 CPU 利用率:工作负载资源下 Pod 的 CPU 使用率。计算方式为:工作负载下所有的 Pod 资源 / 工作负载的请求(request)值。当实际 CPU 用量大于/小于目标值时,系统自动减少/增加 Pod 副本数量。
- 目标内存用量:工作负载资源下的 Pod 的内存用量。当实际内存用量大于/小于目标值时,系统自动减少/增加 Pod 副本数量。
- 副本范围:Pod 副本数的弹性伸缩范围。默认区间为为 1 - 10。
- 副本范围:设置允许的最小容器组副本数量,默认值为 1。设置允许的最大容器组副本数量,默认值为 10。
- 稳定时间窗口:扩缩容的稳定窗口时间需要大于等于 0,小于等于 3600,取值范围为 [0,3600]
- 系统指标:
- CPU 利用率:工作负载资源下 Pod 的 CPU 使用率。计算方式为:工作负载下所有的 Pod 资源 / 工作负载的请求(request)值。当实际 CPU 用量大于/小于目标值时,系统自动减少/增加 Pod 副本数量。
- 内存用量:工作负载资源下的 Pod 的内存用量。当实际内存用量大于/小于目标值时,系统自动减少/增加 Pod 副本数量。
- 自定义指标:参见[基于自定义指标创建 HPA](./custom-hpa.md)

6. 完成参数配置后,点击 __确定__ 按钮,自动返回弹性伸缩详情页面。点击列表右侧的 ____ ,可以执行编辑、删除操作,还可以查看相关事件。

Expand Down

0 comments on commit c82baff

Please sign in to comment.