ERJAN
ERJAN

Reputation: 24516

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?

Upvotes: 0

Views: 133

Answers (1)

Blender Fox
Blender Fox

Reputation: 5635

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

Upvotes: 2

Related Questions