92
92
93
93
` ` ` yaml
94
94
resources:
95
- - name: CPU
95
+ - name: cpu
96
96
weight: 1
97
- - name: Memory
97
+ - name: memory
98
98
weight: 1
99
99
` ` `
100
100
@@ -104,9 +104,9 @@ It can be used to add extended resources as follows:
104
104
resources:
105
105
- name: intel.com/foo
106
106
weight: 5
107
- - name: CPU
107
+ - name: cpu
108
108
weight: 3
109
- - name: Memory
109
+ - name: memory
110
110
weight: 1
111
111
` ` `
112
112
@@ -123,16 +123,16 @@ Requested resources:
123
123
124
124
` ` `
125
125
intel.com/foo : 2
126
- Memory : 256MB
127
- CPU : 2
126
+ memory : 256MB
127
+ cpu : 2
128
128
` ` `
129
129
130
130
Resource weights :
131
131
132
132
` ` `
133
133
intel.com/foo : 5
134
- Memory : 1
135
- CPU : 3
134
+ memory : 1
135
+ cpu : 3
136
136
` ` `
137
137
138
138
FunctionShapePoint {{0, 0}, {100, 10}}
@@ -142,13 +142,13 @@ Node 1 spec:
142
142
` ` `
143
143
Available:
144
144
intel.com/foo: 4
145
- Memory : 1 GB
146
- CPU : 8
145
+ memory : 1 GB
146
+ cpu : 8
147
147
148
148
Used:
149
149
intel.com/foo: 1
150
- Memory : 256MB
151
- CPU : 1
150
+ memory : 256MB
151
+ cpu : 1
152
152
` ` `
153
153
154
154
Node score :
@@ -161,13 +161,13 @@ intel.com/foo = resourceScoringFunction((2+1),4)
161
161
= rawScoringFunction(75)
162
162
= 7 # floor(75/10)
163
163
164
- Memory = resourceScoringFunction((256+256),1024)
164
+ memory = resourceScoringFunction((256+256),1024)
165
165
= (100 -((1024-512)*100/1024))
166
166
= 50 # requested + used = 50% * available
167
167
= rawScoringFunction(50)
168
168
= 5 # floor(50/10)
169
169
170
- CPU = resourceScoringFunction((2+1),8)
170
+ cpu = resourceScoringFunction((2+1),8)
171
171
= (100 -((8-3)*100/8))
172
172
= 37.5 # requested + used = 37.5% * available
173
173
= rawScoringFunction(37.5)
@@ -182,12 +182,12 @@ Node 2 spec:
182
182
` ` `
183
183
Available:
184
184
intel.com/foo: 8
185
- Memory : 1GB
186
- CPU : 8
185
+ memory : 1GB
186
+ cpu : 8
187
187
Used:
188
188
intel.com/foo: 2
189
- Memory : 512MB
190
- CPU : 6
189
+ memory : 512MB
190
+ cpu : 6
191
191
` ` `
192
192
193
193
Node score :
@@ -200,13 +200,13 @@ intel.com/foo = resourceScoringFunction((2+2),8)
200
200
= rawScoringFunction(50)
201
201
= 5
202
202
203
- Memory = resourceScoringFunction((256+512),1024)
203
+ memory = resourceScoringFunction((256+512),1024)
204
204
= (100 -((1024-768)*100/1024))
205
205
= 75
206
206
= rawScoringFunction(75)
207
207
= 7
208
208
209
- CPU = resourceScoringFunction((2+6),8)
209
+ cpu = resourceScoringFunction((2+6),8)
210
210
= (100 -((8-8)*100/8))
211
211
= 100
212
212
= rawScoringFunction(100)
0 commit comments