Kubernetes pod状态出现CrashLoopBackOff 的原因

网友投稿 487 2022-10-21

Kubernetes pod状态出现CrashLoopBackOff 的原因

做个实验:

$ kubectl run crasher --image=rosskukulinski/crashing-app

查看这个pod的状态:

$ kubectl get pods

NAME READY STATUS RESTARTS AGE

crasher-2443551393-vuehs 0/1 CrashLoopBackOff 2 54s

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

用describe命令查看明细:

$ kubectl describe pod crasher-2443551393-vuehs

Name: crasher-2443551393-vuehs

Namespace: fail

Node: gke-nrhk-1-default-pool-a101b974-wfp7/10.142.0.2

Start Time: Fri, 10 Feb 2019 14:20:29 -0500

Labels: pod-template-hash=2443551393

run=crasher

Status: Running

IP: 10.0.0.74

Controllers: ReplicaSet/crasher-2443551393

Containers:

crasher:

Container ID: docker://51c940ab32016e6d6b5ed28075357661fef3282cb3569117b0f815a199d01c60

Image: rosskukulinski/crashing-app

Image ID: docker://sha256:cf7452191b34d7797a07403d47a1ccf5254741d4bb356577b8a5de40864653a5

Port:

State: Terminated

Reason: Error

Exit Code: 1

Started: Fri, 10 Feb 2017 14:22:24 -0500

Finished: Fri, 10 Feb 2017 14:22:26 -0500

Last State: Terminated

Reason: Error

Exit Code: 1

Started: Fri, 10 Feb 2017 14:21:39 -0500

Finished: Fri, 10 Feb 2017 14:21:40 -0500

Ready: False

Restart Count: 4

Pod状态变为Terminated,Exit Code 是 1。

查看应用日志:

$ kubectl logs crasher-2443551393-vuehs

查看前一个容器:

$ kubectl logs crasher-2443551393-vuehs --previous

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:#yyds干货盘点#Docker的基础知识(1)
下一篇:Java深入浅出数组的定义与使用下篇
相关文章

 发表评论

暂时没有评论,来抢沙发吧~