使用kubectl describe pod <pod name>查看异常 pod 的状态:
Containers :
kubedns :
Container ID :
docker ://5fb8adf9ee62afc6d3f6f3d9590041818750b392dff015d7091eaaf99cf1c945
Image: ccr.ccs.tencentyun.com/library/kubedns-amd64:1.14.4
Image ID: docker-pullable://ccr.ccs.tencentyun.com/library/kubedns- amd64@sha256:40790881bbe9ef4ae4ff7fe8b892498eecb7fe6dcc22661402f271e03f7de344
Ports: 10053/UDP, 10053/TCP, 10055/TCP
Host Ports: 0/UDP, 0/TCP, 0/TCP
Args:
--domain=cluster.local.
--dns-port=10053
--config-dir=/kube-dns-config
--v=2
State: Running
Started: Tue, 15 Aug 2022 10:58:49 +0800
Last State: Terminated
Reason: Error
Exit Code: 255
Started: Tue, 15 Aug 2022 10:40:42 +0800
Finished: Tue, 15 Aug 2022 10:58:27 +0800
Ready: True
Restart Count: 1
在容器列表里看 Last State 字段,其中 ExitCode 即程序上次退出

本文介绍如何使用kubectldescribepod命令查看Pod的状态,特别关注异常退出的容器及其退出状态码,包括状态码的意义及转换规则,并讨论了常见的异常状态码如137、1和255所对应的潜在问题。
1932

被折叠的 条评论
为什么被折叠?



