$ kubectl apply -f CrashLoopBackoff_1.yaml
pod/nodeapp created

$ kubectl get pods
NAME      READY   STATUS      RESTARTS      AGE
nodeapp   0/1     Completed   3 (38s ago)   52s

$ kubectl get pods
NAME      READY   STATUS             RESTARTS      AGE
nodeapp   0/1     CrashLoopBackOff   5 (92s ago)   2m56s

$ kubectl describe pods nodeapp
Name:             nodeapp
Namespace:        default
Priority:         0
Service Account:  default
Node:             minikube/192.168.49.2
Start Time:       Mon, 22 Jan 2024 07:55:54 +0000
Labels:           name=nodeapp
Annotations:      <none>
Status:           Running
IP:               10.244.0.9
IPs:
  IP:  10.244.0.9
Containers:
  nodeapp:
    Container ID:   docker://df7956bbb8b73b6e19a76857c0e0241ef7cf5ab3223a376cc67e35df6bfbe9fb
    Image:          alpine
    Image ID:       docker-pullable://alpine@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48
    Port:           8080/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Mon, 22 Jan 2024 07:58:44 +0000
      Finished:     Mon, 22 Jan 2024 07:58:44 +0000
    Ready:          False
    Restart Count:  5
    Limits:
      cpu:     500m
      memory:  128Mi
    Requests:
      cpu:        500m
      memory:     128Mi
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-kr6dz (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  kube-api-access-kr6dz:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Guaranteed
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   Scheduled  3m42s                  default-scheduler  Successfully assigned default/nodeapp to minikube
  Normal   Pulled     3m41s                  kubelet            Successfully pulled image "alpine" in 135ms (135ms including waiting)
  Normal   Pulled     3m41s                  kubelet            Successfully pulled image "alpine" in 112ms (112ms including waiting)
  Normal   Pulled     3m28s                  kubelet            Successfully pulled image "alpine" in 115ms (115ms including waiting)
  Normal   Started    3m (x4 over 3m41s)     kubelet            Started container nodeapp
  Normal   Pulled     3m                     kubelet            Successfully pulled image "alpine" in 131ms (131ms including waiting)
  Warning  BackOff    2m33s (x6 over 3m40s)  kubelet            Back-off restarting failed container nodeapp in pod nodeapp_default(1840a657-6965-4304-89c9-ee3b49985e87)
  Normal   Pulling    2m18s (x5 over 3m41s)  kubelet            Pulling image "alpine"
  Normal   Created    2m18s (x5 over 3m41s)  kubelet            Created container nodeapp
  Normal   Pulled     2m18s                  kubelet            Successfully pulled image "alpine" in 156ms (156ms including waiting)

The reason for CrashLoopBackOff to this pod there is no any application up and running, suppose if tomcat application is up and running then container also keeps up and running and the pod will be running always.

$ kubectl delete pod nodeapp

$ kubectl apply -f CrashLoopBackoff_2.yml
pod/nodeapp created

$ kubectl describe pods nodeapp
Name:             nodeapp
Namespace:        default
Priority:         0
Service Account:  default
Node:             minikube/192.168.49.2
Start Time:       Mon, 22 Jan 2024 14:38:17 +0000
Labels:           name=nodeapp
Annotations:      <none>
Status:           Succeeded
IP:               10.244.0.13
IPs:
  IP:  10.244.0.13
Containers:
  nodeapp:
    Container ID:   docker://7db5d9075d5ec7ed880c7e684042d3c73b4779577f2f42febd27407d742837d3
    Image:          alpine
    Image ID:       docker-pullable://alpine@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48
    Port:           8080/TCP
    Host Port:      0/TCP
    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Mon, 22 Jan 2024 14:38:18 +0000
      Finished:     Mon, 22 Jan 2024 14:38:18 +0000
    Ready:          False
    Restart Count:  0
    Limits:
      cpu:     500m
      memory:  128Mi
    Requests:
      cpu:        500m
      memory:     128Mi
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-ht5tb (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  kube-api-access-ht5tb:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Guaranteed
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  11s   default-scheduler  Successfully assigned default/nodeapp to minikube
  Normal  Pulling    11s   kubelet            Pulling image "alpine"
  Normal  Pulled     10s   kubelet            Successfully pulled image "alpine" in 161ms (161ms including waiting)
  Normal  Created    10s   kubelet            Created container nodeapp
  Normal  Started    10s   kubelet            Started container nodeapp

$ kubectl delete -f CrashLoopBackoff_2.yml
