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

Time:01-28

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?

CodePudding user response:

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

  •  Tags:  
  • Related