在kubernetes中查看崩溃的pod的日志文件 [英] View log files of crashed pods in kubernetes

查看:1745
本文介绍了在kubernetes中查看崩溃的pod的日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何想法要在kubernetes中查看崩溃的pod的日志文件? 我的pod在启动了copyingController之后将其状态列为"CrashLoopBackOff".我搜索了可用的文档,但找不到任何文档.

Any idea to view the log files of a crashed pod in kubernetes? My pod is listing it's state as "CrashLoopBackOff" after started the replicationController. I search the available docs and couldn't find any.

推荐答案

kubectl logs <podname> --previous

$ kubectl日志-h
-p,--previous [= false]:如果为true,则在容器中打印容器中先前实例的日志.

$ kubectl logs -h
-p, --previous[=false]: If true, print the logs for the previous instance of the container in a pod if it exists.

这篇关于在kubernetes中查看崩溃的pod的日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆