<p>We have a Rancher Kubernetes cluster where sometimes the pods get stuck in <code>terminating</code> status when we try to delete the corresponding deployment, as shown below.</p>
<pre><code>$  kubectl get deployments
NAME                              DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
...
storage-manager-deployment        1         0         0            0           1d
...
$ kubectl delete deployments storage-manager-deployment
kubectl delete deployments storage-manager-deployment
deployment.extensions &quot;storage-manager-deployment&quot; deleted
C-c C-c^C
$ kubectl get po 
NAME                                             READY     STATUS   RESTARTS   AGE
...
storage-manager-deployment-6d56967cdd-7bgv5      0/1   Terminating      0      23h
...
$ kubectl delete pods storage-manager-deployment-6d56967cdd-7bgv5 --grace-period=0 --force
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod &quot;storage-manager-deployment-6d56967cdd-7bgv5&quot; force deleted
C-c C-c^C  
</code></pre>
<p>Both the delete commands (for the <code>deployment</code> and the <code>pod</code>) get stuck and need to be stopped manually.</p>
<p>We have tried both</p>
<p><code>kubectl delete pod NAME --grace-period=0 --force</code></p>
<p>and</p>
<p><code>kubectl delete pod NAME --now</code></p>
<p>without any luck.</p>
<p>We have also set <code>fs.may_detach_mounts=1</code>, so it seems that all the similar questions already on StackOverflow don't apply to our problem.</p>
<p>If we check the node on which the incriminated pod runs, it does not appear in the <code>docker ps</code> list.</p>
<p>Any suggestion?</p>
<p>Thanks</p>

gruggie
<p>Check the pod spec for an array: 'finalizers'</p>

<pre><code>finalizers:
- cattle-system
</code></pre>

<p>If this exists, remove it, and the pod will terminate.</p>
