<p>I have a deployment that deploys a single pod with a persistent volume claim. If I switch off the node it is running on, after a while k8s terminates the pod and tries to spin it up elsewhere. However the new pod cannot attach the volume (Multi-Attach error for volume &quot;pvc-...&quot;).</p>
<p>I can manually delete the old 'Terminating' pod with <code>kubectl delete pod &lt;PODNAME&gt; --grace-period=0 --force</code> and then things recover.</p>
<p>Is there a way to get Kubernetes to force delete the 'Terminating' pods after a timeout or something? Tx.</p>

David Tinker
<p>According to <a href="https://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod/" rel="nofollow noreferrer">the docs</a>:</p>
<blockquote>
<p>A Pod is not deleted automatically when a node is unreachable. The
Pods running on an unreachable Node enter the 'Terminating' or
'Unknown' state after a timeout. Pods may also enter these states when
the user attempts graceful deletion of a Pod on an unreachable Node.
The only ways in which a Pod in such a state can be removed from the
apiserver are as follows:</p>
<ul>
<li>The Node object is deleted (either by you, or by the Node Controller).</li>
<li>The kubelet on the unresponsive Node starts responding, kills the Pod and removes the entry from the apiserver.</li>
<li>Force deletion of the Pod by the user.</li>
</ul>
</blockquote>
<p>So I assume you are not deleting nor draining the node that is being shut down.
In general I'd advice to ensure any broken nodes are deleted from the node list and that should make <code>Terminating</code> pods to be deleted by controller manager.
Node deletion normally happens automatically, at least on kubernetes clusters running on the main cloud providers, but if that's not happening for you than you need a way to remove nodes that are not healthy.</p>
