-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
register a terminating pod if containers running #124890
base: master
Are you sure you want to change the base?
Conversation
Hi @olyazavr. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/sig node |
/ok-to-test |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: olyazavr 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 |
/triage accepted |
gomega.Eventually(ctx, func(ctx context.Context) error { | ||
return verifyPodDisappeared(ctx, f.ClientSet, podName, ns) | ||
}, 2*time.Minute, time.Second*1).Should(gomega.BeNil()) |
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.
gomega.Eventually(ctx, func(ctx context.Context) error { | |
return verifyPodDisappeared(ctx, f.ClientSet, podName, ns) | |
}, 2*time.Minute, time.Second*1).Should(gomega.BeNil()) | |
gomega.Eventually(ctx, func() bool { | |
_, err := cl.CoreV1().Pods(ns).Get(ctx, name, metav1.GetOptions{}) | |
return apierrors.IsNotFound(err) | |
}, 2*time.Minute, time.Second).Should(gomega.BeTrue()) |
It'll be easier.
"github.com/onsi/gomega" | ||
) | ||
|
||
var _ = SIGDescribe("TerminatingPod", func() { |
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.
I think it should move to test/e2e_node/terminate_pods_test.go
Signed-off-by: Olga Shestopalova <oshestopalova1@gmail.com>
Signed-off-by: Olga Shestopalova <oshestopalova1@gmail.com>
Signed-off-by: Olga Shestopalova <oshestopalova1@gmail.com>
0c98f49
to
4331dd7
Compare
/retest |
What type of PR is this?
/kind bug
What this PR does / why we need it:
When a pod is terminating, but its containers are still running (eg. it's running a prestop hook), and then kubelet restarts, it will re-sync but not the volumes, and that causes this error:
MountVolume.SetUp failed for volume \"kube-public-cert\" : object \"browsers-dashboard\"/\"kube-public-cert\" not registered"
which can only be resolved by force-deleting the podSee this gist for logs: https://gist.github.com/olyazavr/f1980620e89dead80e72a23fcfe2014d
Basically we want this logic that happens in SyncPod but in the SyncTerminatingPod flow
Testing: I have a pod with a prestop hook to sleep for 10m, and a secret mounted on it. I kill the pod, then restart kubelet. Without this change, it will error out with the mount volume error, and with it, that error does not appear and the pod terminates gracefully
Which issue(s) this PR fixes:
Fixes #113289
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: