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
Copy
  • Pod Description
Copy
  • Kubelet Error
Copy

Environment

  • Platform9 Managed Kubernetes - All Versions

Cause

In this case, the /var/lib/kubelet directory has a symlink associated to it.

Copy

Resolution

Temporary Quick Fix

  1. Manually unmount the volume.
Copy
  1. Manually force delete the Pod.
Copy

Long Term Solution

This involves making a change to the existing setup. On every host where the symlink persists, perform the following operations.

  1. Stop pf9-hostagent service.
Copy
  1. Stop pf9-kube service.
Copy
  1. Drop the symlink for /var/lib/kubelet.
Copy
  1. Start pf9-hostagent service.
Copy

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.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard