如何使用Kubectl命令列出运行POD的容器及其信息
当我们运行kubectl时,pod =>它列出了在吊舱内运行的容器的计数并重新启动计数。因此,我不确定哪个容器会重新启动。我要么需要登录到UI,要么使用Kubectl描述POD。
NAME READY STATUS RESTARTS AGE
test-pod 2/2 Running 5 14h
但是,我需要使用Kubectl命令符号来查看每个容器名称及其重新启动计数,如下所示。
NAME STATUS RESTARTS AGE
container-1 Running 2 14h
container-2 Running 3 14h
如果有人帮助我,这将有所帮助。提前致谢!
When we run kubectl get pod => it is listing the count of containers running inside a pod and restart count. So I am not sure which container gets restarted. Either I need to login to UI or using kubectl describe pods.
NAME READY STATUS RESTARTS AGE
test-pod 2/2 Running 5 14h
But I need to see each container names and its restart count using kubectl command somethings as below.
NAME STATUS RESTARTS AGE
container-1 Running 2 14h
container-2 Running 3 14h
It would be helpful if someone helps me on this. Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试这样的事情:
您将获得结果容器名称,restartcount和状态。
然后,您将能够根据需要将其格式化。
You can try something like this:
You will get in result container-name, restartCount and state.
Then you will be able to format it in such way as you need.