热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Kubernetes问题整理

Kubernetes问题整理CrashLoopBackOff错误CrashLoopBackOff的含义是,Kubernetes试图启动该Pod,但是

Kubernetes问题整理


CrashLoopBackOff错误

CrashLoopBackOff的含义是,Kubernetes试图启动该Pod,但是过程中出现错误,导致容器启动失败或者正在被删除。

pod报错"Back-off restarting failed container"解决办法
链接地址:https://blog.csdn.net/sqhren626232/article/details/101013390

解决方法:在deployment申明镜像的后面加上命令
command: [ “/bin/bash”, “-ce”, “tail -f /dev/null” ]
command: [“sleep”,“3600”]

查找问题

[root@master1 ~]# kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
activemq-deployment-d89bcb469-5tlkn 0/1 CrashLoopBackOff 5 7m35s 10.244.3.7 node2

查看pod的详细信息(图)
在这里插入图片描述


Pod 一直处于 ImagePullBackOff 状态

https://www.bookstack.cn/read/kubernetes-practice-guide/troubleshooting-problems-pod-keep-imagepullbackoff.md


k8s创建应用一直卡在 ContainerCreating的解决办法

https://www.cnbugs.com/post-3276.html


Unable to update cni config: No networks found in /etc/cni/net.d

vi /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf
添加
Environment=“KUBELET_NETWORK_ARGS=–network-plugin=cni --cni-conf-dir=/etc/cni/ --cni-bin-dir=/opt/cni/bin”

重新加载
systemctl daemon-reload
systemctl restart kubelet


Kubernetes报错Failed to get system container stats for “/system.slice/docker.service”: failed to get cgroup stats for “/system.slice/docker.service”

[root@master1 net.d]# systemctl status kubelet
● kubelet.service - kubelet: The Kubernetes Node AgentLoaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)Drop-In: /usr/lib/systemd/system/kubelet.service.d└─10-kubeadm.confActive: active (running) since Sun 2021-03-21 09:43:20 CST; 1 day 7h agoDocs: https://kubernetes.io/docs/Main PID: 829 (kubelet)Tasks: 17Memory: 93.6MCGroup: /system.slice/kubelet.service└─829 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --cgroup-driver=systemd --network-plugin=cni --pod-infra-...Mar 22 17:21:59 master1 kubelet[829]: E0322 17:21:59.967531 829 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats for "/system.slice/docker.service":...
Mar 22 17:22:10 master1 kubelet[829]: E0322 17:22:09.999160 829 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats for "/system.slice/docker.service":...
Mar 22 17:22:20 master1 kubelet[829]: E0322 17:22:20.018321 829 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats for "/system.slice/docker.service":...
Mar 22 17:22:30 master1 kubelet[829]: E0322 17:22:30.044959 829 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats for "/system.slice/docker.service":...
Mar 22 17:22:40 master1 kubelet[829]: E0322 17:22:40.069868 829 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats for "/system.slice/docker.service":...

推荐阅读
author-avatar
飛仔2502897013
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有