6
6
使用一个简单的命令、一个 UI 或基于 CPU 使用情况自动对应用程序进行扩缩。
7
7
content_type : concept
8
8
weight : 90
9
+ math : true
9
10
---
10
11
<!--
11
12
reviewers:
@@ -19,6 +20,7 @@ feature:
19
20
Scale your application up and down with a simple command, with a UI, or automatically based on CPU usage.
20
21
content_type: concept
21
22
weight: 90
23
+ math: true
22
24
-->
23
25
24
26
<!-- overview -->
@@ -224,25 +226,30 @@ value:
224
226
从最基本的角度来看,Pod 水平自动扩缩控制器根据当前指标和期望指标来计算扩缩比例。
225
227
226
228
<!--
227
- ```
228
- desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]
229
+ ```math
230
+ \begin{equation*}
231
+ desiredReplicas = \left( currentReplicas \times { currentMetricValue \over desiredMetricValue } \right)
232
+ \end{equation*}
229
233
```
230
234
-->
231
- ```
232
- 期望副本数 = ceil[当前副本数 * (当前指标 / 期望指标)]
235
+ ``` math
236
+ \begin{equation*}
237
+ 期望副本数 = \left( 当前副本数 \times { 当前指标 \over 期望指标 } \right)
238
+ \end{equation*}
233
239
```
234
240
235
241
<!--
236
242
For example, if the current metric value is `200m`, and the desired value
237
- is `100m`, the number of replicas will be doubled, since `200.0 / 100.0 ==
238
- 2.0` If the current value is instead `50m`, you'll halve the number of
239
- replicas, since `50.0 / 100.0 == 0.5`. The control plane skips any scaling
243
+ is `100m`, the number of replicas will be doubled, since
244
+ \\( { 200.0 \div 100.0 } = 2.0 \\).
245
+ If the current value is instead `50m`, you'll halve the number of
246
+ replicas, since \\( { 50.0 \div 100.0 } = 0.5 \\). The control plane skips any scaling
240
247
action if the ratio is sufficiently close to 1.0 (within a globally-configurable
241
248
tolerance, 0.1 by default).
242
249
-->
243
250
例如,如果当前指标值为 ` 200m ` ,而期望值为 ` 100m ` ,则副本数将加倍,
244
- 因为 ` 200.0 / 100.0 == 2.0 ` 如果当前值为 ` 50m ` ,则副本数将减半,
245
- 因为 ` 50.0 / 100.0 == 0.5 ` 。如果比率足够接近 1.0(在全局可配置的容差范围内,默认为 0.1),
251
+ 因为 \\ ( { 200.0 \div 100.0 } = 2.0 \\ )。 如果当前值为 ` 50m ` ,则副本数将减半,
252
+ 因为 \\ ( { 50.0 \div 100.0 } = 0.5 \\ ) 。如果比率足够接近 1.0(在全局可配置的容差范围内,默认为 0.1),
246
253
则控制平面会跳过扩缩操作。
247
254
248
255
<!--
@@ -302,10 +309,10 @@ default is 5 minutes.
302
309
该值由 ` -horizontal-pod-autoscaler-cpu-initialization-period ` 标志配置,默认为 5 分钟。
303
310
304
311
<!--
305
- The ` currentMetricValue / desiredMetricValue` base scale ratio is then
306
- calculated using the remaining pods not set aside or discarded from above.
312
+ The \\( currentMetricValue \over desiredMetricValue \\) base scale ratio is then
313
+ calculated, using the remaining pods not set aside or discarded from above.
307
314
-->
308
- 在排除掉被搁置的 Pod 后,扩缩比例就会根据 ` currentMetricValue/desiredMetricValue `
315
+ 在排除掉被搁置的 Pod 后,扩缩比例就会根据 \\ ( 当前指标 \over 预期指标 \\ )
309
316
计算出来。
310
317
311
318
<!--
0 commit comments