Skip to content

Commit 2f821d7

Browse files
authored
Merge pull request #21907 from tengqm/zh-res-binpacking
[zh] Improve translation for resource bin packing
2 parents 85401fc + 67a6519 commit 2f821d7

File tree

1 file changed

+77
-89
lines changed

1 file changed

+77
-89
lines changed
Lines changed: 77 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
---
2-
reviewers:
3-
- bsalamat
4-
- k82cn
5-
- ahg-g
6-
title: 扩展资源的资源箱打包
2+
title: 扩展资源的资源装箱
73
content_type: concept
8-
weight: 10
4+
weight: 50
95
---
106
<!--
11-
---
12-
reviewers:
13-
- bsalamat
14-
- k82cn
15-
- ahg-g
167
title: Resource Bin Packing for Extended Resources
178
content_type: concept
18-
weight: 10
19-
---
9+
weight: 50
2010
-->
2111

2212
<!-- overview -->
@@ -26,46 +16,48 @@ weight: 10
2616
<!--
2717
The kube-scheduler can be configured to enable bin packing of resources along with extended resources using `RequestedToCapacityRatioResourceAllocation` priority function. Priority functions can be used to fine-tune the kube-scheduler as per custom needs.
2818
-->
29-
可以将 kube-scheduler 配置为使用 `RequestedToCapacityRatioResourceAllocation` 优先级函数启用资源箱打包以及扩展资源。
30-
优先级函数可用于根据自定义需求微调 kube-scheduler 。
31-
3219

20+
使用 `RequestedToCapacityRatioResourceAllocation` 优先级函数,可以将 kube-scheduler
21+
配置为支持包含扩展资源在内的资源装箱操作。
22+
优先级函数可用于根据自定义需求微调 kube-scheduler 。
3323

3424
<!-- body -->
3525

3626
<!--
3727
## Enabling Bin Packing using RequestedToCapacityRatioResourceAllocation
38-
-->
39-
## 使用 RequestedToCapacityRatioResourceAllocation 启用装箱
4028
41-
<!--
4229
Before Kubernetes 1.15, Kube-scheduler used to allow scoring nodes based on the request to capacity ratio of primary resources like CPU and Memory. Kubernetes 1.16 added a new parameter to the priority function that allows the users to specify the resources along with weights for each resource to score nodes based on the request to capacity ratio. This allows users to bin pack extended resources by using appropriate parameters improves the utilization of scarce resources in large clusters. The behavior of the `RequestedToCapacityRatioResourceAllocation` priority function can be controlled by a configuration option called `requestedToCapacityRatioArguments`. This argument consists of two parameters `shape` and `resources`. Shape allows the user to tune the function as least requested or most requested based on `utilization` and `score` values. Resources
4330
consists of `name` which specifies the resource to be considered during scoring and `weight` specify the weight of each resource.
4431
-->
45-
在 Kubernetes 1.15 之前,Kube-scheduler 用于允许根据主要资源,如 CPU 和内存对容量之比的请求对节点进行评分。
46-
Kubernetes 1.16 在优先级函数中添加了一个新参数,该参数允许用户指定资源以及每个资源的权重,以便根据容量之比的请求为节点评分。
47-
这允许用户通过使用适当的参数来打包扩展资源,从而提高了大型集群中稀缺资源的利用率。
48-
`RequestedToCapacityRatioResourceAllocation` 优先级函数的行为可以通过名为 `requestedToCapacityRatioArguments` 的配置选项进行控制。
49-
这个论证由两个参数 `shape``resources` 组成。
50-
Shape 允许用户根据 `utilization``score` 值将功能调整为要求最少或要求最高的功能。
51-
资源由 `name``weight` 组成,`name` 指定评分时要考虑的资源,`weight` 指定每种资源的权重。
32+
33+
## 使用 RequestedToCapacityRatioResourceAllocation 启用装箱
34+
35+
在 Kubernetes 1.15 之前,Kube-scheduler 通常允许根据对主要资源(如 CPU 和内存)的请求数量和可用容量
36+
之比率对节点评分。
37+
Kubernetes 1.16 在优先级函数中添加了一个新参数,该参数允许用户指定资源以及每类资源的权重,
38+
以便根据请求数量与可用容量之比率为节点评分。
39+
这就使得用户可以通过使用适当的参数来对扩展资源执行装箱操作,从而提高了大型集群中稀缺资源的利用率。
40+
`RequestedToCapacityRatioResourceAllocation` 优先级函数的行为可以通过名为
41+
`requestedToCapacityRatioArguments` 的配置选项进行控制。
42+
该标志由两个参数 `shape``resources` 组成。
43+
shape 允许用户根据 `utilization``score` 值将函数调整为最少请求(least requested)或
44+
最多请求(most requested)计算。
45+
resources 由 `name``weight` 组成,`name` 指定评分时要考虑的资源,`weight` 指定每种资源的权重。
5246

5347
<!--
5448
Below is an example configuration that sets `requestedToCapacityRatioArguments` to bin packing behavior for extended resources `intel.com/foo` and `intel.com/bar`
5549
-->
56-
以下是一个配置示例,该配置将 `requestedToCapacityRatioArguments` 设置为扩展资源 `intel.com/foo``intel.com/bar` 的装箱行为
50+
51+
以下是一个配置示例,该配置将 `requestedToCapacityRatioArguments` 设置为对扩展资源
52+
`intel.com/foo``intel.com/bar` 的装箱行为
5753

5854
```json
5955
{
6056
"kind" : "Policy",
6157
"apiVersion" : "v1",
62-
6358
...
64-
6559
"priorities" : [
66-
6760
...
68-
6961
{
7062
"name": "RequestedToCapacityRatioPriority",
7163
"weight": 2,
@@ -89,16 +81,17 @@ Below is an example configuration that sets `requestedToCapacityRatioArguments`
8981
<!--
9082
**This feature is disabled by default**
9183
-->
92-
**默认情况下禁用此功能**
84+
85+
**默认情况下此功能处于被禁用状态**
9386

9487
<!--
9588
### Tuning RequestedToCapacityRatioResourceAllocation Priority Function
96-
-->
97-
### 调整 RequestedToCapacityRatioResourceAllocation 优先级函数
9889
99-
<!--
10090
`shape` is used to specify the behavior of the `RequestedToCapacityRatioPriority` function.
10191
-->
92+
93+
### 调整 RequestedToCapacityRatioResourceAllocation 优先级函数
94+
10295
`shape` 用于指定 `RequestedToCapacityRatioPriority` 函数的行为。
10396

10497
```yaml
@@ -109,8 +102,9 @@ Below is an example configuration that sets `requestedToCapacityRatioArguments`
109102
<!--
110103
The above arguments give the node a score of 0 if utilization is 0% and 10 for utilization 100%, thus enabling bin packing behavior. To enable least requested the score value must be reversed as follows.
111104
-->
112-
上面的参数在利用率为 0% 时给节点评分为0,在利用率为 100% 时给节点评分为10,因此启用了装箱行为。
113-
要启用最少请求,必须按如下方式反转得分值。
105+
106+
上面的参数在 utilization 为 0% 时给节点评分为 0,在 utilization 为 100% 时给节点评分为 10,
107+
因此启用了装箱行为。要启用最少请求(least requested)模式,必须按如下方式反转得分值。
114108

115109
```yaml
116110
{"utilization": 0, "score": 100},
@@ -124,9 +118,9 @@ The above arguments give the node a score of 0 if utilization is 0% and 10 for u
124118

125119
``` yaml
126120
"resources": [
127-
{"name": "CPU", "weight": 1},
128-
{"name": "Memory", "weight": 1}
129-
]
121+
{"name": "CPU", "weight": 1},
122+
{"name": "Memory", "weight": 1}
123+
]
130124
```
131125

132126
<!--
@@ -136,66 +130,65 @@ It can be used to add extended resources as follows:
136130

137131
```yaml
138132
"resources": [
139-
{"name": "intel.com/foo", "weight": 5},
140-
{"name": "CPU", "weight": 3},
141-
{"name": "Memory", "weight": 1}
142-
]
133+
{"name": "intel.com/foo", "weight": 5},
134+
{"name": "CPU", "weight": 3},
135+
{"name": "Memory", "weight": 1}
136+
]
143137
```
144138

145139
<!--
146140
The weight parameter is optional and is set to 1 if not specified. Also, the weight cannot be set to a negative value.
147141
-->
148-
weight 参数是可选的,如果未指定,则设置为1
149-
同样, weight 不能设置为负值。
142+
weight 参数是可选的,如果未指定,则设置为 1
143+
同时,weight 不能设置为负值。
150144

151145
<!--
152146
### How the RequestedToCapacityRatioResourceAllocation Priority Function Scores Nodes
153-
-->
154-
### RequestedToCapacityRatioResourceAllocation 优先级函数如何对节点评分
155147
156-
<!--
157148
This section is intended for those who want to understand the internal details
158149
of this feature.
159150
Below is an example of how the node score is calculated for a given set of values.
160151
-->
161-
本部分适用于希望了解此功能的内部细节的人员。
162-
以下是如何针对给定的一组值计算节点得分的示例。
152+
153+
### RequestedToCapacityRatioResourceAllocation 优先级函数如何对节点评分
154+
155+
本节适用于希望了解此功能的内部细节的人员。
156+
以下是如何针对给定的一组值来计算节点得分的示例。
163157

164158
```
165-
Requested Resources
159+
请求的资源
166160
167-
intel.com/foo : 2
161+
intel.com/foo: 2
168162
Memory: 256MB
169163
CPU: 2
170164
171-
Resource Weights
165+
资源权重
172166
173-
intel.com/foo : 5
167+
intel.com/foo: 5
174168
Memory: 1
175169
CPU: 3
176170
177171
FunctionShapePoint {{0, 0}, {100, 10}}
178172
179-
Node 1 Spec
180-
181-
Available:
182-
intel.com/foo : 4
183-
Memory : 1 GB
184-
CPU: 8
173+
节点 Node 1 配置
185174
186-
Used:
187-
intel.com/foo: 1
188-
Memory: 256MB
189-
CPU: 1
175+
可用:
176+
intel.com/foo : 4
177+
Memory : 1 GB
178+
CPU: 8
190179
180+
已用:
181+
intel.com/foo: 1
182+
Memory: 256MB
183+
CPU: 1
191184
192-
Node Score:
185+
节点得分:
193186
194187
intel.com/foo = resourceScoringFunction((2+1),4)
195-
= (100 - ((4-3)*100/4)
196-
= (100 - 25)
197-
= 75
198-
= rawScoringFunction(75)
188+
= (100 - ((4-3)*100/4)
189+
= (100 - 25)
190+
= 75
191+
= rawScoringFunction(75)
199192
= 7
200193
201194
Memory = resourceScoringFunction((256+256),1024)
@@ -214,27 +207,25 @@ NodeScore = (7 * 5) + (5 * 1) + (3 * 3) / (5 + 1 + 3)
214207
= 5
215208
216209
217-
Node 2 Spec
210+
节点 Node 2 配置
218211
219-
Available:
220-
intel.com/foo: 8
221-
Memory: 1GB
222-
CPU: 8
223-
224-
Used:
225-
226-
intel.com/foo: 2
227-
Memory: 512MB
228-
CPU: 6
212+
可用:
213+
intel.com/foo: 8
214+
Memory: 1GB
215+
CPU: 8
229216
217+
已用:
218+
intel.com/foo: 2
219+
Memory: 512MB
220+
CPU: 6
230221
231-
Node Score:
222+
节点得分:
232223
233224
intel.com/foo = resourceScoringFunction((2+2),8)
234-
= (100 - ((8-4)*100/8)
235-
= (100 - 25)
236-
= 50
237-
= rawScoringFunction(50)
225+
= (100 - ((8-4)*100/8)
226+
= (100 - 25)
227+
= 50
228+
= rawScoringFunction(50)
238229
= 5
239230
240231
Memory = resourceScoringFunction((256+512),1024)
@@ -251,8 +242,5 @@ CPU = resourceScoringFunction((2+6),8)
251242
252243
NodeScore = (5 * 5) + (7 * 1) + (10 * 3) / (5 + 1 + 3)
253244
= 7
254-
255245
```
256246

257-
258-

0 commit comments

Comments
 (0)