<p>When I want to restart the kubernetes(<code>v1.21.2</code>) statefulset pod, the pod are stuck with terminating status, and the log shows like this:</p>
<pre><code>error killing pod: failed to &quot;KillPodSandbox&quot; for &quot;8aafe99f-53c1-4bec-8cb8-abd09af1448f&quot; with KillPodSandboxError: &quot;rpc error: code = Unknown desc = failed to check network namespace closed: remove netns: unlinkat /var/run/netns/cni-f9ccb1de-ed43-dff6-1b86-1260e07178e6: device or resource busy&quot;
</code></pre>
<p>the pod terminate for hours but still stuck. why did this happen? what should I do to fixed this problem?</p>

<p>I think force deletion can be a workaround for this issue.</p>
<p>In order to delete the affected pod that is in the terminating state, please refer to the <a href="https://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod/#delete-pods" rel="nofollow noreferrer">documentation</a>. In case the pod still does not get deleted then you can do the force deletion by following <a href="https://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod/#force-deletion" rel="nofollow noreferrer">documentation</a>.</p>
<p>Please note that when you force delete a StatefulSet pod, you are asserting that the Pod in question will never again make contact with other Pods in the StatefulSet and its name can be safely freed up for a replacement to be created.</p>
<p>You can also try these workarounds to quickly mitigate this</p>
<ol>
<li>Run the command below to remove all pods in the terminating state.</li>
</ol>
<blockquote>
<p>for p in $(kubectl get pods | grep Terminating | awk '{print $1}'); do
kubectl delete pod $p --grace-period=0 --force;done</p>
</blockquote>
<p>2.Set finalizer value in the deployment YAML to null.</p>
