|
26 | 26 | - [Scenario 7. Risk of porting existing sidecars to the new mechanism naively](#scenario-7-risk-of-porting-existing-sidecars-to-the-new-mechanism-naively)
|
27 | 27 | - [Design Details](#design-details)
|
28 | 28 | - [Backward compatibility](#backward-compatibility)
|
| 29 | + - [kubectl changes](#kubectl-changes) |
29 | 30 | - [Resources calculation for scheduling and pod admission](#resources-calculation-for-scheduling-and-pod-admission)
|
30 | 31 | - [Exposing Pod Resource requirements](#exposing-pod-resource-requirements)
|
31 | 32 | - [Goals of exposing the Pod.TotalResourcesRequested field](#goals-of-exposing-the-podtotalresourcesrequested-field)
|
32 | 33 | - [Implementation details](#implementation-details)
|
33 | 34 | - [Notes for implementation](#notes-for-implementation)
|
34 | 35 | - [Resources calculation and Pod QoS evaluation](#resources-calculation-and-pod-qos-evaluation)
|
| 36 | + - [Resource calculation and version skew](#resource-calculation-and-version-skew) |
35 | 37 | - [Topology and CPU managers](#topology-and-cpu-managers)
|
36 | 38 | - [Termination of containers](#termination-of-containers)
|
37 | 39 | - [Other](#other)
|
|
81 | 83 |
|
82 | 84 | Items marked with (R) are required *prior to targeting to a milestone / release*.
|
83 | 85 |
|
84 |
| -- [ ] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR) |
85 |
| -- [ ] (R) KEP approvers have approved the KEP status as `implementable` |
86 |
| -- [ ] (R) Design details are appropriately documented |
87 |
| -- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) |
| 86 | +- [X] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR) |
| 87 | +- [X] (R) KEP approvers have approved the KEP status as `implementable` |
| 88 | +- [X] (R) Design details are appropriately documented |
| 89 | +- [X] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) |
88 | 90 | - [ ] e2e Tests for all Beta API Operations (endpoints)
|
89 | 91 | - [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
|
90 | 92 | - [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free
|
@@ -243,9 +245,8 @@ condition is represented with the field `Started` of `ContainerStatus` type. See
|
243 | 245 | the section ["Pod startup completed condition"](#pod-startup-completed-condition)
|
244 | 246 | for considerations on picking this signal.
|
245 | 247 |
|
246 |
| -As part of the KEP, init containers and regular containers will be split into |
247 |
| -two different types. The field `restartPolicy` will only be introduced on init |
248 |
| -containers. The only supported value proposed in this KEP is `Always`. No other |
| 248 | +The field `restartPolicy` will only be accepted on init |
| 249 | +containers as part of this KEP. The only supported value proposed in this KEP is `Always`. No other |
249 | 250 | values will be defined as part of this KEP. Moreover, the field will be
|
250 | 251 | nullable so the default value will be "no value".
|
251 | 252 |
|
@@ -274,7 +275,7 @@ containers in the Pod. This intent to solve the issue
|
274 | 275 | https://github.com/kubernetes/kubernetes/issues/111356
|
275 | 276 |
|
276 | 277 | As part of this KEP we also will be enabling for sidecar containers (those will
|
277 |
| -not be enabled for other init containers): |
| 278 | +not be allowed for other init containers): |
278 | 279 | - `PostStart` and `PreStop` lifecycle handlers for sidecar containers
|
279 | 280 | - All probes (startup, readiness, liveness)
|
280 | 281 | - Readiness probes of sidecars will contribute to determine the whole Pod
|
@@ -525,6 +526,11 @@ Behaviors they can rely on:
|
525 | 526 |
|
526 | 527 | These potential incompatibilities will be documented.
|
527 | 528 |
|
| 529 | +### kubectl changes |
| 530 | + |
| 531 | +The `kubectl get pods` filters all the Init containers from output when Pod is Running. |
| 532 | +As part of this KEP, the output will be extended to include status of Init Containers. |
| 533 | + |
528 | 534 | ### Resources calculation for scheduling and pod admission
|
529 | 535 |
|
530 | 536 | When calculating whether Pod will fit the Node, resource limits and requests are
|
@@ -586,7 +592,7 @@ represent the actual resources in use. The KEP notes that:
|
586 | 592 | > `Status.ContainerStatuses[i].ResourcesAllocated` when considering available
|
587 | 593 | > space on a node.
|
588 | 594 |
|
589 |
| -We can introduce `ContainerUse` to represent this value: |
| 595 | +We will introduce `ContainerUse` to represent this value: |
590 | 596 |
|
591 | 597 | ```
|
592 | 598 | ContainerUse(i) = Max(Spec.Containers[i].Resources, Status.ContainerStatuses[i].ResourcesAllocated)
|
@@ -699,6 +705,24 @@ The logic in
|
699 | 705 | not likely will need changes, but needs to be tested with the sidecar
|
700 | 706 | containers.
|
701 | 707 |
|
| 708 | +#### Resource calculation and version skew |
| 709 | + |
| 710 | +In case of a version skew between scheduler and kubeler, or in cases when |
| 711 | +scheduler and kubelet has a different value set for the `Sidecar` feature gate, |
| 712 | +calculation of resources required for a Pod will differ between the scheduler |
| 713 | +and a kubelet when the sidecar container created. |
| 714 | + |
| 715 | +In case when scheduler "knows" about the sidecar and kubelet doesn't, there |
| 716 | +unlikely be any issues. Scheduler will calculate resources usage for a Pod that |
| 717 | +will be equal or more than kubelet will require to run the Pod. So there will be |
| 718 | +no overbooking. |
| 719 | + |
| 720 | +If scheduler has the `Sidecar` feature gate disabled, the Pod that has a Sidecar |
| 721 | +container will not be admitted as validation of the new field will fail. |
| 722 | + |
| 723 | +We will recommend in documentation to not disable the feature gate on scheduler, |
| 724 | +while there are any Pods with Sidecar container is running. |
| 725 | + |
702 | 726 | ### Topology and CPU managers
|
703 | 727 |
|
704 | 728 | [NodeResourcesFit scheduler plugin](https://github.com/kubernetes/kubernetes/blob/release-1.26/pkg/scheduler/framework/plugins/noderesources/fit.go#L160-L176)
|
@@ -984,26 +1008,31 @@ First, there will be no effect on any workload that doesn't use a new field. Any
|
984 | 1008 | combination of feature gate enabled/disabled or version skew will work as usual
|
985 | 1009 | for that workload.
|
986 | 1010 |
|
987 |
| -So when the new functionality wasn't yet used, downgrade will not be affected. |
| 1011 | +When the new functionality wasn't yet used, downgrade will not be affected. |
988 | 1012 |
|
989 | 1013 | Due to the new field added to `initContainers` to turn them into sidecars,
|
990 | 1014 | downgrading to the version without this feature will make all Pods using this
|
991 |
| -flag unscheduleable. New Pods will be rejected by the control plane and |
992 |
| -all kubelets. Pods that has already been created will not be rejected by control |
993 |
| -plane, but once reaching the kubelet, that has this feature disabled or which |
994 |
| -is old, kubelet will reject the Pod on unmarshalling. |
995 |
| - |
996 |
| -**Note**, we tested kubelet behavior. For the control plane we may need |
997 |
| -to implement a new logic to reject such Pods when feature gate got turned off. |
| 1015 | +flag unscheduleable. New Pods will be rejected by the control plane. |
| 1016 | + |
| 1017 | +Pods that has already been created will not be rejected by control |
| 1018 | +plane nor by kubelet. Both will treat the sidecar container as an Init container. |
| 1019 | +This may render the Pod unusable as it will stuck in initialization forever - |
| 1020 | +sidecar container are never exiting. We will document this behavior for Alpha release. |
| 1021 | +Promoting feature to Beta we will revisit the situation. If we will see this as |
| 1022 | +a major issue, we will need to wait for 3 releases so kubelet will have the logic |
| 1023 | +to reject such Pods when the feature gate is disabled to keep Downgrade safe. |
| 1024 | + |
| 1025 | +**Note**, For the control plane and kubelet we will implement logic to reject Pods |
| 1026 | +with sidecar containers when feature gate got turned off. |
998 | 1027 | See [Upgrade/downgrade testing](#upgradedowngrade-testing) section.
|
999 | 1028 |
|
1000 | 1029 | Workloads will have to be deleted and recreated with the old way of handling
|
1001 | 1030 | sidecars. Once there is no more Pods using sidecars, node can be downgraded
|
1002 | 1031 | without side effects.
|
1003 | 1032 |
|
1004 |
| -If downgrade hapenning from the version with the feature enabled to the previous |
| 1033 | +If downgrade happening from the version with the feature enabled to the previous |
1005 | 1034 | version that has this feature support, but feature gate is disabled, kubelet
|
1006 |
| -and/or control place will reject these Pods. |
| 1035 | +and control place will reject these Pods. |
1007 | 1036 |
|
1008 | 1037 | **Note**, downgrade requires node drain. So we will not support scenarios when
|
1009 | 1038 | Pod already running on the node will need to be handled by the restarted
|
|
0 commit comments