-
Notifications
You must be signed in to change notification settings - Fork 40.9k
WIP: Add RestartContainerDuringTermination feature #125710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
WIP: Add RestartContainerDuringTermination feature #125710
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
dc8af25
to
a2fdfd5
Compare
a2fdfd5
to
cb0164e
Compare
/test pull-kubernetes-node-kubelet-serial-containerd-sidecar-containers |
cb0164e
to
12b5db2
Compare
/test pull-kubernetes-node-kubelet-serial-containerd-sidecar-containers |
pkg/kubelet/kubelet.go
Outdated
var podStopped bool | ||
var err error | ||
if !utilfeature.DefaultFeatureGate.Enabled(features.RestartContainerDuringTermination) { | ||
p := kubecontainer.ConvertPodStatusToRunningPod(kl.getRuntime().Type(), podStatus) | ||
err = kl.killPod(ctx, pod, p, gracePeriod) | ||
} else { | ||
podStopped, err = kl.syncTerminatingPod(ctx, pod, podStatus, gracePeriod, kl.getPullSecretsForPod(pod), kl.backOff) | ||
} | ||
if err != nil { | ||
kl.recorder.Eventf(pod, v1.EventTypeWarning, events.FailedToKillPod, "error killing pod: %v", err) | ||
// there was an error killing the pod, so we return that error directly | ||
utilruntime.HandleError(err) | ||
return err | ||
} | ||
|
||
if !podStopped { | ||
// If the pod is not yet stopped, we should return an error to signal | ||
// that the sync loop should back off. | ||
return fmt.Errorf("pod is not yet stopped") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @smarterclayton
https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/4438-container-restart-termination
This PR is trying to change the (*kubelet).killPod in a non-blocking way so that other parts of the syncLoop can work during the container termination.
What do you think?
pkg/features/kube_features.go
Outdated
@@ -1158,6 +1166,9 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS | |||
|
|||
ServiceTrafficDistribution: {Default: false, PreRelease: featuregate.Alpha}, | |||
|
|||
// FIXME: Disable by default | |||
RestartContainerDuringTermination: {Default: true, PreRelease: featuregate.Alpha}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this before merge?
12b5db2
to
a54bf2e
Compare
hi @gjkim42 froim sig-node ! the 1.33 code freeze deadline is looming and this PR is still marked as WIP. Are still up for the 1.33 milestone? do you need reviews? |
Unfortunately, I don't have the bandwidth to work on this PR. |
I can check if you want... did you have some pending changes to push? |
No, I didn't. I still couldn't check the test case you mentioned before. |
ack, no worries, just checking to plan the rest of the time till the code freeze |
9c789d2
to
024bc2f
Compare
e29a2f7
to
af633df
Compare
07c592e
to
f9d74f3
Compare
21a8232
to
bf98fec
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gjkim42 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bf98fec
to
e77f9fd
Compare
Signed-off-by: Matthias Bertschy <[email protected]>
Signed-off-by: Matthias Bertschy <[email protected]>
e77f9fd
to
f1b7bd7
Compare
@gjkim42: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #121398
TODOs
Should transition to Failed phase a pod which is deleted while pending
This manages container termination in a non-blocking way.
xref:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/uncc all