开发者

For Kubernetes pods how to find cause of exit code 2

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜