Pods Stuck In the Terminating State Due to Volume Unmount Error.

Problem

  • Pods are getting stuck in Terminating state after the deletion with the below mentioned error.
Volume Unmount Error
Copy

Environment

  • Platform9 Managed Kubernetes - All Versions
  • Operating System: RHEL or CentOS v7.4 Onwards

Answer

  • This has been a known issue with RHEL and CentOS systems and starting with RHEL7.4 kernel there is a new sysctl parameter available to overcome this behaviour .
  • This parameter is may_detach_mounts and its value is set to0 by default.
  • It can be enabled by executing the below mentioned command on the appropriate kubernetes cluster nodes.
Command to enable the sysctl parameter
Copy
  • The kubelet will retry to unmount the projected volumes after enabling may_detach_mounts on the node.
  • This can take a few minutes and once done the terminating pod should get deleted from the node.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard