'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?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source