Skip to content

Commit cefdc27

Browse files
authored
Merge pull request #49719 from windsonsea/autosy
[zh] Sync horizontal-pod-autoscale.md
2 parents 37b54fe + 4545548 commit cefdc27

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

content/zh-cn/docs/tasks/run-application/horizontal-pod-autoscale.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ feature:
66
使用一个简单的命令、一个 UI 或基于 CPU 使用情况自动对应用程序进行扩缩。
77
content_type: concept
88
weight: 90
9+
math: true
910
---
1011
<!--
1112
reviewers:
@@ -19,6 +20,7 @@ feature:
1920
Scale your application up and down with a simple command, with a UI, or automatically based on CPU usage.
2021
content_type: concept
2122
weight: 90
23+
math: true
2224
-->
2325

2426
<!-- overview -->
@@ -224,25 +226,30 @@ value:
224226
从最基本的角度来看,Pod 水平自动扩缩控制器根据当前指标和期望指标来计算扩缩比例。
225227

226228
<!--
227-
```
228-
desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]
229+
```math
230+
\begin{equation*}
231+
desiredReplicas = \left( currentReplicas \times { currentMetricValue \over desiredMetricValue } \right)
232+
\end{equation*}
229233
```
230234
-->
231-
```
232-
期望副本数 = ceil[当前副本数 * (当前指标 / 期望指标)]
235+
```math
236+
\begin{equation*}
237+
期望副本数 = \left( 当前副本数 \times { 当前指标 \over 期望指标 } \right)
238+
\end{equation*}
233239
```
234240

235241
<!--
236242
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
240247
action if the ratio is sufficiently close to 1.0 (within a globally-configurable
241248
tolerance, 0.1 by default).
242249
-->
243250
例如,如果当前指标值为 `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),
246253
则控制平面会跳过扩缩操作。
247254

248255
<!--
@@ -302,10 +309,10 @@ default is 5 minutes.
302309
该值由 `-horizontal-pod-autoscaler-cpu-initialization-period` 标志配置,默认为 5 分钟。
303310

304311
<!--
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.
307314
-->
308-
在排除掉被搁置的 Pod 后,扩缩比例就会根据 `currentMetricValue/desiredMetricValue`
315+
在排除掉被搁置的 Pod 后,扩缩比例就会根据 \\( 当前指标 \over 预期指标 \\)
309316
计算出来。
310317

311318
<!--

0 commit comments

Comments
 (0)