<p>We are following a microservice based architecture, where I deploy my application inside a kubernetes cluster by helm package. I have a nodejs application which queries cron jobs from database and should add these jobs to crontab file inside the same container.</p>

<p>So when I expose my container as a nodejs app in a port, I will  make a add job request and these jobs are formatted to cron job type, and these entries needed to be added to crontab and execute these jobs in background.</p>

<p>Can this be achieved?</p>

<p>If yes, on what base image should I build my node application?</p>

<p>And what are the steps I should include to my docker file, to also verify my cron executed logs, run both node application and cron jobs?</p>

Shruthi Bhaskar
<p>I understand that you are looking for a job scheduler, by my experience putting more than 1 process per container is not the best idea, maybe you can use another approach using an extra microservice that runs that jobs.</p>

<p>I recommend using Agenda</p>

<p><a href="https://github.com/agenda/agenda" rel="nofollow noreferrer">https://github.com/agenda/agenda</a></p>

<p>You can create an Agenda worker that has the code for the different jobs and the only thing that you need is to send a scheduled job or now execution, by this architecture you can have multiple agendas also as a sidecar container inside the same pod of your node application.</p>
