@@ -112,8 +112,11 @@ scheduler.
112
112
` shape` 用于指定 `RequestedToCapacityRatioPriority` 函数的行为。
113
113
114
114
` ` ` yaml
115
- {"utilization": 0, "score": 0},
116
- {"utilization": 100, "score": 10}
115
+ shape:
116
+ - utilization: 0
117
+ score: 0
118
+ - utilization: 100
119
+ score: 10
117
120
` ` `
118
121
119
122
<!--
@@ -125,8 +128,11 @@ The above arguments give the node a score of 0 if utilization is 0% and 10 for u
125
128
要启用最少请求(least requested)模式,必须按如下方式反转得分值。
126
129
127
130
` ` ` yaml
128
- {"utilization": 0, "score": 10},
129
- {"utilization": 100, "score": 0}
131
+ shape:
132
+ - utilization: 0
133
+ score: 10
134
+ - utilization: 100
135
+ score: 0
130
136
` ` `
131
137
132
138
<!--
@@ -135,10 +141,11 @@ The above arguments give the node a score of 0 if utilization is 0% and 10 for u
135
141
` resources` 是一个可选参数,默认情况下设置为:
136
142
137
143
` ` ` yaml
138
- "resources": [
139
- {"name": "CPU", "weight": 1},
140
- {"name": "Memory", "weight": 1}
141
- ]
144
+ resources:
145
+ - name: cpu
146
+ weight: 1
147
+ - name: memory
148
+ weight: 1
142
149
` ` `
143
150
144
151
<!--
@@ -147,11 +154,13 @@ It can be used to add extended resources as follows:
147
154
它可以用来添加扩展资源,如下所示:
148
155
149
156
` ` ` yaml
150
- "resources": [
151
- {"name": "intel.com/foo", "weight": 5},
152
- {"name": "CPU", "weight": 3},
153
- {"name": "Memory", "weight": 1}
154
- ]
157
+ resources:
158
+ - name: intel.com/foo
159
+ weight: 5
160
+ - name: cpu
161
+ weight: 3
162
+ - name: memory
163
+ weight: 1
155
164
` ` `
156
165
157
166
<!--
@@ -161,44 +170,44 @@ weight 参数是可选的,如果未指定,则设置为 1。
161
170
同时,weight 不能设置为负值。
162
171
163
172
<!--
164
- # ## How the RequestedToCapacityRatioResourceAllocation Priority Function Scores Nodes
173
+ # ## Node scoring for capacity allocation
165
174
166
175
This section is intended for those who want to understand the internal details
167
176
of this feature.
168
177
Below is an example of how the node score is calculated for a given set of values.
169
178
-->
170
179
171
- # ## RequestedToCapacityRatioResourceAllocation 优先级函数如何对节点评分
180
+ # ## 节点容量分配的评分
172
181
173
182
本节适用于希望了解此功能的内部细节的人员。
174
183
以下是如何针对给定的一组值来计算节点得分的示例。
175
184
176
185
```
177
186
请求的资源
178
187
179
- intel.com/foo: 2
180
- Memory : 256MB
181
- CPU : 2
188
+ intel.com/foo : 2
189
+ memory : 256MB
190
+ cpu : 2
182
191
183
192
资源权重
184
193
185
- intel.com/foo: 5
186
- Memory : 1
187
- CPU : 3
194
+ intel.com/foo : 5
195
+ memory : 1
196
+ cpu : 3
188
197
189
198
FunctionShapePoint {{0, 0}, {100, 10}}
190
199
191
200
节点 Node 1 配置
192
201
193
202
可用:
194
203
intel.com/foo : 4
195
- Memory : 1 GB
196
- CPU : 8
204
+ memory : 1 GB
205
+ cpu : 8
197
206
198
207
已用:
199
208
intel.com/foo: 1
200
- Memory : 256MB
201
- CPU : 1
209
+ memory : 256MB
210
+ cpu : 1
202
211
203
212
节点得分:
204
213
@@ -209,13 +218,13 @@ intel.com/foo = resourceScoringFunction((2+1),4)
209
218
= rawScoringFunction(75)
210
219
= 7
211
220
212
- Memory = resourceScoringFunction((256+256),1024)
221
+ memory = resourceScoringFunction((256+256),1024)
213
222
= (100 -((1024-512)* 100/1024))
214
223
= 50
215
224
= rawScoringFunction(50)
216
225
= 5
217
226
218
- CPU = resourceScoringFunction((2+1),8)
227
+ cpu = resourceScoringFunction((2+1),8)
219
228
= (100 -((8-3)* 100/8))
220
229
= 37.5
221
230
= rawScoringFunction(37.5)
@@ -229,13 +238,13 @@ NodeScore = (7 * 5) + (5 * 1) + (3 * 3) / (5 + 1 + 3)
229
238
230
239
可用:
231
240
intel.com/foo: 8
232
- Memory : 1GB
233
- CPU : 8
241
+ memory : 1GB
242
+ cpu : 8
234
243
235
244
已用:
236
245
intel.com/foo: 2
237
- Memory : 512MB
238
- CPU : 6
246
+ memory : 512MB
247
+ cpu : 6
239
248
240
249
节点得分:
241
250
@@ -246,13 +255,13 @@ intel.com/foo = resourceScoringFunction((2+2),8)
246
255
= rawScoringFunction(50)
247
256
= 5
248
257
249
- Memory = resourceScoringFunction((256+512),1024)
258
+ memory = resourceScoringFunction((256+512),1024)
250
259
= (100 -((1024-768)* 100/1024))
251
260
= 75
252
261
= rawScoringFunction(75)
253
262
= 7
254
263
255
- CPU = resourceScoringFunction((2+6),8)
264
+ cpu = resourceScoringFunction((2+6),8)
256
265
= (100 -((8-8)* 100/8))
257
266
= 100
258
267
= rawScoringFunction(100)
0 commit comments