Commit 72bf3d9
UPSTREAM: <carry>: add new admission for handling shared cpus
Adding a new mutation plugin that handles the following:
1. In case of `workload.openshift.io/enable-shared-cpus` request, it
adds an annotation to hint runtime about the request. runtime
is not aware of extended resources, hence we need the annotation.
2. It validates the pod's QoS class and return an error if it's not a
guaranteed QoS class
3. It validates that no more than a single resource is being request.
4. It validates that the pod deployed in a namespace that has mixedcpus
workloads allowed annotation.
For more information see - openshift/enhancements#1396
Signed-off-by: Talor Itzhak <[email protected]>
UPSTREAM: <carry>: Update management webhook pod admission logic
Updating the logic for pod admission to allow a pod creation with workload partitioning annotations to be run in a namespace that has no workload allow annoations.
The pod will be stripped of its workload annotations and treated as if it were normal, a warning annoation will be placed to note the behavior on the pod.
Signed-off-by: ehila <[email protected]>
UPSTREAM: <carry>: add support for cpu limits into management workloads
Added support to allow workload partitioning to use the CPU limits for a container, to allow the runtime to make better decisions around workload cpu quotas we are passing down the cpu limit as part of the cpulimit value in the annotation. CRI-O will take that information and calculate the quota per node. This should support situations where workloads might have different cpu period overrides assigned.
Updated kubelet for static pods and the admission webhook for regular to support cpu limits.
Updated unit test to reflect changes.
Signed-off-by: ehila <[email protected]>1 parent 2b89bd4 commit 72bf3d9
File tree
8 files changed
+660
-65
lines changed- openshift-kube-apiserver/admission
- admissionenablement
- autoscaling
- managementcpusoverride
- mixedcpus
- pkg/kubelet/managed
8 files changed
+660
-65
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
Lines changed: 54 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
220 | 235 | | |
221 | 236 | | |
222 | 237 | | |
| |||
245 | 260 | | |
246 | 261 | | |
247 | 262 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | 263 | | |
256 | 264 | | |
257 | 265 | | |
| |||
353 | 361 | | |
354 | 362 | | |
355 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
356 | 372 | | |
357 | 373 | | |
358 | 374 | | |
| |||
361 | 377 | | |
362 | 378 | | |
363 | 379 | | |
364 | | - | |
365 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
366 | 392 | | |
| 393 | + | |
367 | 394 | | |
368 | 395 | | |
369 | 396 | | |
| |||
378 | 405 | | |
379 | 406 | | |
380 | 407 | | |
381 | | - | |
| 408 | + | |
382 | 409 | | |
383 | 410 | | |
384 | 411 | | |
| |||
425 | 452 | | |
426 | 453 | | |
427 | 454 | | |
428 | | - | |
| 455 | + | |
429 | 456 | | |
430 | 457 | | |
431 | 458 | | |
| |||
449 | 476 | | |
450 | 477 | | |
451 | 478 | | |
| 479 | + | |
452 | 480 | | |
453 | 481 | | |
| 482 | + | |
| 483 | + | |
454 | 484 | | |
455 | | - | |
| 485 | + | |
456 | 486 | | |
457 | 487 | | |
458 | 488 | | |
| |||
559 | 589 | | |
560 | 590 | | |
561 | 591 | | |
562 | | - | |
| 592 | + | |
| 593 | + | |
563 | 594 | | |
564 | 595 | | |
565 | 596 | | |
566 | 597 | | |
| 598 | + | |
567 | 599 | | |
568 | | - | |
569 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
570 | 604 | | |
571 | 605 | | |
572 | | - | |
573 | 606 | | |
574 | 607 | | |
575 | 608 | | |
| |||
586 | 619 | | |
587 | 620 | | |
588 | 621 | | |
589 | | - | |
590 | | - | |
591 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
592 | 625 | | |
593 | 626 | | |
594 | 627 | | |
| |||
599 | 632 | | |
600 | 633 | | |
601 | 634 | | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
| 635 | + | |
| 636 | + | |
617 | 637 | | |
618 | 638 | | |
619 | 639 | | |
| |||
Lines changed: 55 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
170 | 189 | | |
171 | 190 | | |
172 | 191 | | |
173 | 192 | | |
174 | 193 | | |
175 | 194 | | |
176 | | - | |
177 | | - | |
| 195 | + | |
| 196 | + | |
178 | 197 | | |
179 | 198 | | |
180 | 199 | | |
| |||
217 | 236 | | |
218 | 237 | | |
219 | 238 | | |
220 | | - | |
| 239 | + | |
221 | 240 | | |
222 | | - | |
| 241 | + | |
223 | 242 | | |
224 | 243 | | |
225 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
226 | 247 | | |
227 | 248 | | |
228 | 249 | | |
| |||
239 | 260 | | |
240 | 261 | | |
241 | 262 | | |
242 | | - | |
| 263 | + | |
243 | 264 | | |
244 | 265 | | |
245 | 266 | | |
246 | 267 | | |
247 | | - | |
| 268 | + | |
248 | 269 | | |
249 | 270 | | |
250 | 271 | | |
| |||
407 | 428 | | |
408 | 429 | | |
409 | 430 | | |
410 | | - | |
| 431 | + | |
411 | 432 | | |
412 | 433 | | |
413 | 434 | | |
| |||
437 | 458 | | |
438 | 459 | | |
439 | 460 | | |
440 | | - | |
441 | | - | |
| 461 | + | |
| 462 | + | |
442 | 463 | | |
443 | 464 | | |
444 | 465 | | |
445 | 466 | | |
| 467 | + | |
446 | 468 | | |
447 | | - | |
| 469 | + | |
448 | 470 | | |
449 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
450 | 483 | | |
451 | 484 | | |
452 | 485 | | |
| |||
532 | 565 | | |
533 | 566 | | |
534 | 567 | | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
| 568 | + | |
| 569 | + | |
546 | 570 | | |
547 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
548 | 574 | | |
549 | 575 | | |
550 | 576 | | |
| |||
675 | 701 | | |
676 | 702 | | |
677 | 703 | | |
678 | | - | |
| 704 | + | |
679 | 705 | | |
680 | | - | |
681 | | - | |
| 706 | + | |
682 | 707 | | |
683 | 708 | | |
0 commit comments