如果 Pod 已完成部署,则也可以具有
CrashLoopBackOff
状态,但即使退出代码为零,它也会配置为继续重启。 例如,如果在未指定任何参数的情况下部署 busybox 映像,该映像将启动、运行、完成,然后在循环中重启:
$ kubectl run nginx --image nginx
pod/nginx created
$ kubectl run busybox --image busybox
pod/busybox created
$ kubectl get pods --watch
NAME READY STATUS RESTARTS AGE
busybox 0/1 ContainerCreating 0 3s
nginx 1/1 Running 0 11s
busybox 0/1 Completed 0 3s
busybox 0/1 Completed 1 4s
busybox 0/1 CrashLoopBackOff 1 5s
$ kubectl describe pod busybox
Name: busybox
Namespace: default
Priority: 0
Node: aks-nodepool<number>-<resource-group-hash-number>-vmss<number>/<ip-address-1>
Start Time: Wed, 16 Aug 2023 09:56:19 +0000
Labels: run=busybox
Annotations: <none>
Status: Running
IP: <ip-address-2>
IP: <ip-address-2>
Containers:
busybox:
Container ID: containerd://<64-digit-hexadecimal-value-1>
Image: busybox
Image ID: docker.io/library/busybox@sha256:<64-digit-hexadecimal-value-2>
Port: <none>
Host Port: <none>
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Completed
Exit Code: 0
Started: Wed, 16 Aug 2023 09:56:37 +0000
Finished: Wed, 16 Aug 2023 09:56:37 +0000
Ready: False
Restart Count: 2
如果在节点上创建更多 Pod 后无法识别问题,请在单个节点上运行 Pod 以确定 Pod 实际使用的资源数。
第三方信息免责声明
本文中提到的第三方产品由 Microsoft 以外的其他公司提供。 Microsoft 不对这些产品的性能或可靠性提供任何明示或暗示性担保。
如果你有任何疑问或需要帮助,请创建支持请求或联系 Azure 社区支持。 还可以向 Azure 反馈社区提交产品反馈。