Pod Stuck in Terminating State Due to Inability to Clean Volume subPath Mount
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
Pod Description
Kubelet Error
Environment
Platform9 Managed Kubernetes - All Versions
Cause
In this case, the /var/lib/kubelet directory has a symlink associated to it.
Resolution
Temporary Quick Fix
Manually unmount the volume.
Manually force delete the Pod.
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.
Stop pf9-kube service.
Drop the symlink for /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.
