Search code examples
dockerspring-bootcronopenshiftopenshift-enterprise

How I run a cron job in Openshift?


I have a docker container in Openshift, this docker have a spring boot microservice that I want to execute only every X minutes.

How I can do it using Openshift?

I don't know how to create a cron job or similar to launch this microservice every X minutes.

Thanks!


Solution

  • Assuming you are exposing an http service, you may use a mix between cron in docker and curl with cron, you can configure a cron inside your docker container to send a curl request periodically, invoking your microservice.