本文介绍了Kubernetes Pod终止解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是遇到上述问题的人,在执行"kubectl delete -f"操作后,我的容器将卡在"Terminate"上.我无法在Docker日志中看到任何内容来帮助我缩小范围.Docker重新启动后,吊舱将消失,我可以照常继续操作,但这不是您生活的方式.

I was one that was having trouble with this above mentioned issue where after a "kubectl delete -f" my container would be stuck on "Terminating".I could not see anything in the Docker logs to help me narrow it down.After a Docker restart the pod would be gone and i could continue as usual, but this is not the way to live your life.

我搜索了几个小时,终于在某处的随机帖子中得到了一些东西.

I Googled for hours and finally got something on a random post somewhere.

解决方案:当我在Ubuntu 16.04上安装Kubernetes时,我遵循了一条指导说"install.io".在本文中,它说要删除"docker.io",而是使用"docker-ce或docker-ee"安装.

Solution:When i installed Kubernetes on Ubuntu 16.04 i followed a guide that said to install "docker.io".In this article it said to remove "docker.io" and rather use a "docker-ce or docker-ee" installation.

BOOM,我做到了,禁用了swappoff功能,我的烦恼不再了.

BOOM, i did it, disabled the swappoff function and my troubles are no more.

我希望这对也对此有所帮助的人有所帮助.

I hope this helps people that are also stuck with this.

欢呼

推荐答案

如注释中提到的 kleuf 所述,解决方案在他的情况下,卡住的Docker容器如下:

As kleuf mentioned in comments, the solution to the stuck docker container in his case was the following:

sudo apt-get remove docker docker-engine docker-ce docker.io
sudo apt-get remove docker docker-engine docker.io -y
curl -fsSL download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository  "deb [arch=amd64] download.docker.com/linux/ubuntu  $(lsb_release -cs)  stable"
sudo apt-get update
sudo apt-get install docker-ce -y
sudo service docker restart

我希望这对也对此有所帮助的人有所帮助.

I hope this helps people that are also stuck with this.

这篇关于Kubernetes Pod终止解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-01 13:27