Managed Kubernetes
Latest
Frequently Asked Questions
Solutions
How Tos
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Pod Stuck in Terminating State Due to Inability to Clean Volume subPath Mount
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
A pod is stuck in a terminating state as the configmap mounted as a volume fails to unmount when trying to clean the subPath mount for it.
- Pod Status
xxxxxxxxxxNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE podname 0/1 Terminating 0 3h3m 10.200.42.191 10.3.9.109 [none]- Pod Description
xxxxxxxxxxName: podnameVolumes:config:Type: ConfigMap (a volume populated by a ConfigMap)Name: podnameOptional: false- Kubelet Error
Error: "error cleaning subPath mounts for volume \"config\" (UniqueName: \"kubernetes.io/configmap/b45800b2-1b3f-11ea-928b-005056bcb9b4-config\") pod \"b45800b2-1b3f-11ea-928b-005056bcb9b4\" (UID: \"b45800b2-1b3f-11ea-928b-005056bcb9b4\") : error processing /var/lib/kubelet/pods/b35800b2-1b3f-11ea-928b-005056bcb9b4/volume-subpaths/config/init-filesystem:error cleaning subpath mount /var/lib/kubelet/pods/b45800b2-1b3f-11ea-928b-005056bcb9b4/volume-subpaths/config/init-filesystem/7: remove /var/lib/kubelet/pods/b45800b2-1b3f-11ea-928b-005056bcb9b4/volume-subpaths/config/init-filesystem/7: device or resource busy"Environment
- Platform9 Managed Kubernetes - All Versions
Cause
In this case, the /var/lib/kubelet directory has a symlink associated to it.
xxxxxxxxxx$ ls -l /var/lib/kubelet lrwxrwxrwx. 1 root root XX XXX X YY:YY /var/lib/kubelet -> /mnt/docker-images/kubeletResolution
Temporary Quick Fix
- Manually unmount the volume.
xxxxxxxxxx# umount /var/lib/kubelet/pods/b35800b2-1b3f-11ea-928b-005056bcb9b4/volume-subpaths/config/init-filesystem/7- Manually force delete the Pod.
xxxxxxxxxx$ kubectl delete pod --grace-period=0 --force [pod_name]Long Term Solution
This involves making a change to the existing setup. On every host where the symlink persists, perform the following operations.
- Stop pf9-hostagent service.
xxxxxxxxxx$ systemctl stop pf9-hostagent- Stop pf9-kube service.
xxxxxxxxxx$ systemctl stop pf9-kube- Drop the symlink for /var/lib/kubelet.
xxxxxxxxxx$ rm -rf /var/lib/kubelet- Start pf9-hostagent service.
Additional Information
Note: The bug Issue 65879 talks about setting the Kubelet flag --root-dir to the value referenced by symlink from /var/lib/kubelet to resolve the issue. If the --root-dir value has to be set, it would have to be hard coded as --root-dir isn't an option available for dynamic Kubelet config.
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message