Quantcast
Viewing latest article 2
Browse Latest Browse All 3

Answer by Shudipta Sharma for access logs in cron jobs kubernetes

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>

Viewing latest article 2
Browse Latest Browse All 3

Trending Articles