Cronjob
runs pod according to the spec.schedule
. After completing the task the pod's status will be set as completed
, but cronjob
controller don't delete the pod after completing. And the log file content still there in the pod's container filesystem. So you need to do:
- grep the pod name
$ POD_NAME=kubectl get pods | grep "cron-cronjob1-"
$ kubectl logs -f -n default <pod_name>