吊舱未终止

时间:2018-07-17 10:54:04

标签: kubernetes

我们有一个Rancher Kubernetes集群,当我们尝试删除相应的部署时,有时pod陷入terminating状态,如下所示。

$ 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 "storage-manager-deployment" 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 "storage-manager-deployment-6d56967cdd-7bgv5" force deleted C-c C-c^C

两个删除命令(用于deploymentpod)都被卡住,需要手动停止。

我们都尝试过

kubectl delete pod NAME --grace-period=0 --force

kubectl delete pod NAME --now

没有任何运气。

我们还设置了fs.may_detach_mounts=1,所以看来StackOverflow上已经存在的所有类似问题都不适用于我们的问题。

如果我们检查在其中运行了该Pod的节点,则该节点不会出现在docker ps列表中。

有什么建议吗?

谢谢

1 个答案:

答案 0 :(得分:3)

检查Pod规范中的数组:“ finalizers”

finalizers:
- cattle-system

如果存在,请将其删除,吊舱将终止。