目前我的k8s环境容器是使用的containerd,删除POD以后一直terminating,无法销毁,然后查看terminating的POD有以下事件报错
Normal Killing 8m16s kubelet Stopping container orion-admission-hooks Warning FailedKillPod 8m15s kubelet error killing pod: failed to "KillPodSandbox" for "654ae46c-95bd-485d-950f-eaaefe2a7ca0" with KillPodSandboxError: "rpc error: code = Unknown desc = failed to remove network namespace for sandbox \"0a7f8f58125be5de252499661bed130f238748de61bc998c705ed0780db32507\": failed to remove netns: unlinkat /run/netns/cni-19690d53-50e9-8185-d204-92e90d76d565: device or resource busy" Warning FailedKillPod 3m5s (x26 over 8m14s) kubelet error killing pod: failed to "KillPodSandbox" for "654ae46c-95bd-485d-950f-eaaefe2a7ca0" with KillPodSandboxError: "rpc error: code = Unknown desc = failed to check network namespace closed: remove netns: unlinkat /var/run/netns/cni-19690d53-50e9-8185-d204-92e90d76d565: device or resource busy"
导致这个问题的原因是在CentOS7.4引入了一个新的参数来控制内核的行为。 /proc/sys/fs/may_detach_mounts 默认设置为0;当系统有容器运行的时候,需要将该值设置为1。
我们需要修改内核方面的配置
echo 1 > /proc/sys/fs/may_detach_mounts
使用上述方法以后POD就销毁了,问题解决,但是上述方式重启以后就失效了,我们需要添加到sysctl.conf配置中,并使其生效
echo "fs.may_detach_mounts = 1" >> /etc/sysctl.conf sysctl -p
- 标签
- centos
- pod
- terminating
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://sulao.cn/post/953
相关阅读
- k8s中harbor-database-0日志报Permissions should be u=rwx (0700)的处理方法
- k8s级联删除(删除deployment却删除不了rs和pod)异常问题的处理办法
- k8s中pod使用RDMA网卡的方法(待验证)
- k8s集群中让POD使用固定IP的方法
- k8s业务pod端口检测和日志采集bash脚本
- python获取k8s中使用物理卡pod列表脚本
- centos7安装CUDA Tookit+CUDA Samples+NCCL+OpenMPI
- containerd环境下通过的进程PID查询POD的方法
- centos添加交换分区swap的方法
- pod容器组退出码详细信息介绍
评论列表