@@ -142,8 +142,9 @@ or the custom metrics API (for all other metrics).
142
142
* For per-pod resource metrics (like CPU), the controller fetches the metrics
143
143
from the resource metrics API for each Pod targeted by the HorizontalPodAutoscaler.
144
144
Then, if a target utilization value is set, the controller calculates the utilization
145
- value as a percentage of the equivalent [resource request](/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) on the containers in
146
- each Pod. If a target raw value is set, the raw metric values are used directly.
145
+ value as a percentage of the equivalent
146
+ [resource request](/docs/concepts/configuration/manage-resources-containers/#requests-and-limits)
147
+ on the containers in each Pod. If a target raw value is set, the raw metric values are used directly.
147
148
The controller then takes the mean of the utilization or the raw value (depending on the type
148
149
of target specified) across all targeted Pods, and produces a ratio used to scale
149
150
the number of desired replicas.
@@ -157,9 +158,8 @@ or the custom metrics API (for all other metrics).
157
158
<!--
158
159
Please note that if some of the Pod's containers do not have the relevant resource request set,
159
160
CPU utilization for the Pod will not be defined and the autoscaler will
160
- not take any action for that metric. See the [algorithm
161
- details](#algorithm-details) section below for more information about
162
- how the autoscaling algorithm works.
161
+ not take any action for that metric. See the [algorithm details](#algorithm-details) section below
162
+ for more information about how the autoscaling algorithm works.
163
163
-->
164
164
需要注意的是,如果 Pod 某些容器不支持资源采集,那么控制器将不会使用该 Pod 的 CPU 使用率。
165
165
下面的[ 算法细节] ( #algorithm-details ) 章节将会介绍详细的算法。
@@ -173,13 +173,13 @@ or the custom metrics API (for all other metrics).
173
173
<!--
174
174
* For object metrics and external metrics, a single metric is fetched, which describes
175
175
the object in question. This metric is compared to the target
176
- value, to produce a ratio as above. In the `autoscaling/v2beta2 ` API
176
+ value, to produce a ratio as above. In the `autoscaling/v2 ` API
177
177
version, this value can optionally be divided by the number of Pods before the
178
178
comparison is made.
179
179
-->
180
180
* 如果 Pod 使用对象指标和外部指标(每个指标描述一个对象信息)。
181
181
这个指标将直接根据目标设定值相比较,并生成一个上面提到的扩缩比例。
182
- 在 ` autoscaling/v2beta2 ` 版本 API 中,这个指标也可以根据 Pod 数量平分后再计算。
182
+ 在 ` autoscaling/v2 ` 版本 API 中,这个指标也可以根据 Pod 数量平分后再计算。
183
183
184
184
<!--
185
185
The common use for HorizontalPodAutoscaler is to configure it to fetch metrics from
@@ -212,9 +212,9 @@ HorizontalPodAutoscaler 控制器访问支持扩缩的相应工作负载资源
212
212
请参阅 [ Kubernetes API 概念] ( /zh-cn/docs/reference/using-api/api-concepts/ ) 。
213
213
214
214
<!--
215
- ### Algorithm Details
215
+ ### Algorithm details
216
216
217
- From the most basic perspective, the Horizontal Pod Autoscaler controller
217
+ From the most basic perspective, the HorizontalPodAutoscaler controller
218
218
operates on the ratio between desired metric value and current metric
219
219
value:
220
220
-->
@@ -274,8 +274,8 @@ with missing metrics will be used to adjust the final scaling amount.
274
274
275
275
<!--
276
276
When scaling on CPU, if any pod has yet to become ready (it's still
277
- initializing, or possibly is unhealthy) *or* the most recent metric point for the pod was before it
278
- became ready, that pod is set aside as well.
277
+ initializing, or possibly is unhealthy) *or* the most recent metric point for
278
+ the pod was before it became ready, that pod is set aside as well.
279
279
-->
280
280
当使用 CPU 指标来扩缩时,任何还未就绪(还在初始化,或者可能是不健康的)状态的 Pod ** 或**
281
281
最近的指标度量值采集于就绪状态前的 Pod,该 Pod 也会被搁置。
@@ -489,7 +489,7 @@ pod usage is still within acceptable limits.
489
489
{{< /note >}}
490
490
491
491
<!--
492
- ### Container Resource Metrics
492
+ ### Container resource metrics
493
493
-->
494
494
### 容器资源指标 {#container-resource-metrics}
495
495
@@ -564,6 +564,8 @@ the old container name from the HPA specification.
564
564
<!--
565
565
# # Scaling on custom metrics
566
566
567
+ {{< feature-state for_k8s_version="v1.23" state="stable" >}}
568
+
567
569
(the `autoscaling/v2beta2` API version previously provided this ability as a beta feature)
568
570
569
571
Provided that you use the `autoscaling/v2` API version, you can configure a HorizontalPodAutoscaler
@@ -588,6 +590,8 @@ HorizontalPodAutoscaler 控制器能够从 Kubernetes API 查询这些自定义
588
590
<!--
589
591
# # Scaling on multiple metrics
590
592
593
+ {{< feature-state for_k8s_version="v1.23" state="stable" >}}
594
+
591
595
(the `autoscaling/v2beta2` API version previously provided this ability as a beta feature)
592
596
593
597
Provided that you use the `autoscaling/v2` API version, you can specify multiple metrics for a
@@ -624,7 +628,7 @@ APIs, cluster administrators must ensure that:
624
628
* The corresponding APIs are registered:
625
629
626
630
* For resource metrics, this is the `metrics.k8s.io` API, generally provided by [metrics-server](https://github.com/kubernetes-sigs/metrics-server).
627
- It can be launched as a cluster addon .
631
+ It can be launched as a cluster add-on .
628
632
629
633
* For custom metrics, this is the `custom.metrics.k8s.io` API. It's provided by "adapter" API servers provided by metrics solution vendors.
630
634
Check with your metrics pipeline to see if there is a Kubernetes metrics adapter available.
@@ -646,14 +650,14 @@ APIs, cluster administrators must ensure that:
646
650
647
651
<!--
648
652
For more information on these different metrics paths and how they differ please see the relevant design proposals for
649
- [the HPA V2](https://github.com/kubernetes/ design-proposals-archive/blob/main /autoscaling/hpa-v2.md),
650
- [custom.metrics.k8s.io](https://github.com/kubernetes/ design-proposals-archive/blob/main /instrumentation/custom-metrics-api.md)
651
- and [external.metrics.k8s.io](https://github.com/kubernetes/ design-proposals-archive/blob/main /instrumentation/external-metrics-api.md).
653
+ [the HPA V2](https://git.k8s.io/ design-proposals-archive/autoscaling/hpa-v2.md),
654
+ [custom.metrics.k8s.io](https://git.k8s.io/ design-proposals-archive/instrumentation/custom-metrics-api.md)
655
+ and [external.metrics.k8s.io](https://git.k8s.io/ design-proposals-archive/instrumentation/external-metrics-api.md).
652
656
-->
653
657
关于指标来源以及其区别的更多信息,请参阅相关的设计文档,
654
- [HPA V2](https://github.com/kubernetes/ design-proposals-archive/blob/main /autoscaling/hpa-v2.md),
655
- [custom.metrics.k8s.io](https://github.com/kubernetes/ design-proposals-archive/blob/main /instrumentation/custom-metrics-api.md) 和
656
- [external.metrics.k8s.io](https://github.com/kubernetes/ design-proposals-archive/blob/main /instrumentation/external-metrics-api.md)。
658
+ [HPA V2](https://git.k8s.io/ design-proposals-archive/autoscaling/hpa-v2.md),
659
+ [custom.metrics.k8s.io](https://git.k8s.io/ design-proposals-archive/instrumentation/custom-metrics-api.md) 和
660
+ [external.metrics.k8s.io](https://git.k8s.io/ design-proposals-archive/instrumentation/external-metrics-api.md)。
657
661
658
662
<!--
659
663
For examples of how to use them see [the walkthrough for using custom metrics](/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics)
@@ -666,6 +670,8 @@ and [the walkthrough for using external metrics](/docs/tasks/run-application/hor
666
670
<!--
667
671
# # Configurable scaling behavior
668
672
673
+ {{< feature-state for_k8s_version="v1.23" state="stable" >}}
674
+
669
675
(the `autoscaling/v2beta2` API version previously provided this ability as a beta feature)
670
676
671
677
If you use the `v2` HorizontalPodAutoscaler API, you can use the `behavior` field
@@ -694,7 +700,7 @@ rate of change of replicas while scaling.
694
700
扩缩策略还允许你在扩缩时控制副本的变化率。
695
701
696
702
<!--
697
- # ## Scaling Policies
703
+ # ## Scaling policies
698
704
699
705
One or more scaling policies can be specified in the `behavior` section of the spec.
700
706
When multiple policies are specified the policy which allows the highest amount of
@@ -754,7 +760,7 @@ scaling in that direction.
754
760
将该值设置为 `Disabled` 将完全禁用该方向的扩缩。
755
761
756
762
<!--
757
- # ## Stabilization Window
763
+ # ## Stabilization window
758
764
759
765
The stabilization window is used to restrict the [flapping](#flapping) of
760
766
replica count when the metrics used for scaling keep fluctuating. The autoscaling algorithm
0 commit comments