Skip to content

Commit 28c8bbf

Browse files
move sidecar to milestone 1.28
1 parent 3357c24 commit 28c8bbf

File tree

2 files changed

+53
-24
lines changed

2 files changed

+53
-24
lines changed

keps/sig-node/753-sidecar-containers/README.md

+48-19
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
- [Scenario 7. Risk of porting existing sidecars to the new mechanism naively](#scenario-7-risk-of-porting-existing-sidecars-to-the-new-mechanism-naively)
2727
- [Design Details](#design-details)
2828
- [Backward compatibility](#backward-compatibility)
29+
- [kubectl changes](#kubectl-changes)
2930
- [Resources calculation for scheduling and pod admission](#resources-calculation-for-scheduling-and-pod-admission)
3031
- [Exposing Pod Resource requirements](#exposing-pod-resource-requirements)
3132
- [Goals of exposing the Pod.TotalResourcesRequested field](#goals-of-exposing-the-podtotalresourcesrequested-field)
3233
- [Implementation details](#implementation-details)
3334
- [Notes for implementation](#notes-for-implementation)
3435
- [Resources calculation and Pod QoS evaluation](#resources-calculation-and-pod-qos-evaluation)
36+
- [Resource calculation and version skew](#resource-calculation-and-version-skew)
3537
- [Topology and CPU managers](#topology-and-cpu-managers)
3638
- [Termination of containers](#termination-of-containers)
3739
- [Other](#other)
@@ -81,10 +83,10 @@
8183

8284
Items marked with (R) are required *prior to targeting to a milestone / release*.
8385

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)
8890
- [ ] e2e Tests for all Beta API Operations (endpoints)
8991
- [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
9092
- [ ] (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
243245
the section ["Pod startup completed condition"](#pod-startup-completed-condition)
244246
for considerations on picking this signal.
245247

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
249250
values will be defined as part of this KEP. Moreover, the field will be
250251
nullable so the default value will be "no value".
251252

@@ -274,7 +275,7 @@ containers in the Pod. This intent to solve the issue
274275
https://github.com/kubernetes/kubernetes/issues/111356
275276

276277
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):
278279
- `PostStart` and `PreStop` lifecycle handlers for sidecar containers
279280
- All probes (startup, readiness, liveness)
280281
- Readiness probes of sidecars will contribute to determine the whole Pod
@@ -525,6 +526,11 @@ Behaviors they can rely on:
525526

526527
These potential incompatibilities will be documented.
527528

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+
528534
### Resources calculation for scheduling and pod admission
529535

530536
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:
586592
> `Status.ContainerStatuses[i].ResourcesAllocated` when considering available
587593
> space on a node.
588594
589-
We can introduce `ContainerUse` to represent this value:
595+
We will introduce `ContainerUse` to represent this value:
590596

591597
```
592598
ContainerUse(i) = Max(Spec.Containers[i].Resources, Status.ContainerStatuses[i].ResourcesAllocated)
@@ -699,6 +705,24 @@ The logic in
699705
not likely will need changes, but needs to be tested with the sidecar
700706
containers.
701707

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+
702726
### Topology and CPU managers
703727

704728
[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
9841008
combination of feature gate enabled/disabled or version skew will work as usual
9851009
for that workload.
9861010

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.
9881012

9891013
Due to the new field added to `initContainers` to turn them into sidecars,
9901014
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.
9981027
See [Upgrade/downgrade testing](#upgradedowngrade-testing) section.
9991028

10001029
Workloads will have to be deleted and recreated with the old way of handling
10011030
sidecars. Once there is no more Pods using sidecars, node can be downgraded
10021031
without side effects.
10031032

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
10051034
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.
10071036

10081037
**Note**, downgrade requires node drain. So we will not support scenarios when
10091038
Pod already running on the node will need to be handled by the restarted

keps/sig-node/753-sidecar-containers/kep.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ participating-sigs:
1010
- sig-apps
1111
status: implementable
1212
creation-date: 2018-05-14
13-
last-updated: 2023-02-01
13+
last-updated: 2023-04-27
1414
reviewers:
1515
- "@mrunalp" # overall
1616
- "@ffromani" # resource management
@@ -30,13 +30,13 @@ stage: alpha
3030
# The most recent milestone for which work toward delivery of this KEP has been
3131
# done. This can be the current (upcoming) milestone, if it is being actively
3232
# worked on.
33-
latest-milestone: "v1.27"
33+
latest-milestone: "v1.28"
3434

3535
# The milestone at which this feature was, or is targeted to be, at each stage.
3636
milestone:
37-
alpha: "v1.27"
38-
beta: "v1.28"
39-
stable: "v1.30"
37+
alpha: "v1.28"
38+
beta: "v1.29"
39+
stable: "v1.32"
4040

4141
# The following PRR answers are required at alpha release
4242
# List the feature gate name and the components for which it must be enabled

0 commit comments

Comments
 (0)