繁体   English   中英

鉴于此 while 循环,如何查看 pod 中容器中发生的情况?

[英]how to look what happend in the container in pod given this while loop?

吊舱 yaml 是这样的:

apiVersion: v1
kind: Pod
metadata:
  labels:
    app: front
  name: front
spec:
  containers:
  - image: nginx
    name: front
    command:
    - /bin/sh
    - -c
    - while true; echo date; sleep 2; done #suspect the bug is i forgot to add "do" before echo

描述 pod 并没有多大帮助。 事件部分仅显示“crashloopbackoff”或错误。

如何准确查看根本原因错误?

您将希望查看 pod 的日志:

kubectl logs front

或者

kubectl logs -f front

如果您想按照日志显示

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM