简体   繁体   中英

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

The pod yaml is this:

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

describing pod does not help much. Events section only shows just 'crashloopbackoff' or error.

HOw to see exactly the root cause error?

You will want to see the logs of the pod:

kubectl logs front

or

kubectl logs -f front

if you want to follow the logs as they appear

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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