🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@pioneer4k8s
Copy link

@pioneer4k8s pioneer4k8s commented Dec 10, 2025

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:

orphaned pod \"xxxx\" found, but failed to rmdir() subpath at path /var/lib/kubelet/pods/xxxx/volume-subpaths/xxxx: remove /var/lib/kubelet/pods/xxxx/volume-subpaths/xxxx: device or resource busy

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:

  1. Create a pod that uses a hostPath volume mounted via subPath.
  2. Stop the kubelet on the node where the pod is running.
  3. Force-delete the pod using kubectl delete --force.
  4. Restart the kubelet.

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:

orphaned pod \"xxxx\" found, but failed to rmdir() subpath at path /var/lib/kubelet/pods/xxxx/volume-subpaths/xxxx: remove /var/lib/kubelet/pods/xxxx/volume-subpaths/xxxx: device or resource busy

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. labels Dec 10, 2025
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.35 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.35.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Wed Dec 10 03:39:32 UTC 2025.

@k8s-ci-robot k8s-ci-robot added do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 10, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 10, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 10, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pioneer4k8s
Once this PR has been reviewed and has the lgtm label, please assign random-liu for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@novahe
Copy link
Contributor

novahe commented Dec 10, 2025

Hi, @pioneer4k8s , I think that's fine, but could you add some test cases?

@carlory
Copy link
Member

carlory commented Dec 12, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 12, 2025
@carlory
Copy link
Member

carlory commented Dec 12, 2025

It is a bug fix, please add a release note for it.

@k8s-ci-robot
Copy link
Contributor

@pioneer4k8s: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-linter-hints 1c6e915 link false /test pull-kubernetes-linter-hints
pull-kubernetes-unit-windows-master 1c6e915 link false /test pull-kubernetes-unit-windows-master

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Development

Successfully merging this pull request may close these issues.

4 participants