-
Notifications
You must be signed in to change notification settings - Fork 41.9k
fix(kubelet): ensure subpath volume cleanup on restart when pod was force-deleted while kubelet was stopped #135696
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?
Conversation
|
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Wed Dec 10 03:39:32 UTC 2025. |
|
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. |
|
Hi @pioneer4k8s. Thanks for your PR. I'm waiting for a github.com 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pioneer4k8s 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 |
|
Hi, @pioneer4k8s , I think that's fine, but could you add some test cases? |
|
/ok-to-test |
|
It is a bug fix, please add a release note for it. |
|
@pioneer4k8s: 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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
When the kubelet on a node is stopped, and a pod on that node—which uses a hostPath volume mounted via subPath—is forcibly deleted using kubectl delete --force, the kubelet fails to clean up the corresponding subpath directory at /var/lib/kubelet/pods//volume-subpaths/ upon restart.
After the kubelet restarts, it detects the orphaned pod and repeatedly logs messages similar to:
This occurs because the volume manager, upon kubelet restart after a forced pod deletion, lacks awareness of the pod’s original hostPath setup and cannot auto-unmount the subpath volume, blocking cleanup during reconciliation.
Which issue(s) this PR is related to:
#135698
Special notes for your reviewer:
To reproduce the issue:
After restart, the directory /var/lib/kubelet/pods//volume-subpaths/ will remain on disk and cannot be cleaned up. The kubelet logs will repeatedly show errors such as:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: