Storing Kubernetes CronJob Logs in DB

10/21/2019

My cronjob is configured to run every 30 mins. Is it possible to read and store the cronJob logs to DB? So, The requirement is to store each run in DB along with the status and logs for all the Jobs. This is required to show the Job History with status, duration & logs in a web based application.

-- user1578872
kubernetes

1 Answer

10/21/2019

You have two options: Use an appropriate logging inside the pod that writes to a database (this has nothing to do with kubernetes) or log to stdout and use logging infrastructure that forwards the logs to a database or central log storage like ELK, graylog2 or product that your cloud provider offers.

-- Thomas
Source: StackOverflow