开发者

For Kubernetes pods how to find cause of exit code 2

开发者 https://www.devze.com 2022-12-07 18:13 出处:网络
I have pods that are of kind Cronjob running in parallel. They complete task and run again after fixed interval of 20 minutes as per cron expression. I noticed that some pods are restarting 2-3 times

I have pods that are of kind Cronjob running in parallel. They complete task and run again after fixed interval of 20 minutes as per cron expression. I noticed that some pods are restarting 2-3 times before completing task.

I checked details in kubectl describe pod command and found that pod exit code 2 when it restart due to some error:

Last State:     Terminated
      Reason:       Error
      Exit Code:    2

I sea开发者_运维百科rched about exit code 2 and found that it is misuse of a shell builtin commands. How I can find which shell builtin is misused. How to debug cause of exit code 2.

Thanks in advance.


You can get logs with

kubectl logs my-pod  

Post output here if you can't fix it.

0

精彩评论

暂无评论...
验证码 换一张
取 消