[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: cronjobs - how does this work?





On Wed, Nov 20, 2019, 5:04 AM Just Marvin <marvin the cynical robot gmail com> wrote:
Hi,

     I'm poring through the text at https://docs.openshift.com/container-platform/4.2/nodes/jobs/nodes-nodes-jobs.html#nodes-nodes-jobs-creating-cron_nodes-nodes-jobs . Should I interpret spec.jobTemplate.spec.template.spec.containers.command as a command that exists within the container specified by cronjob.spec.jobTemplate.spec.template.spec.containers.image? I just tried spinning up an openjdk-11-rhel7 image (by itself, using new-app) and it refused to start up because it is coded to expect some main class / other entrypoint specified to it. If I wanted to run java code in a batch process, would this (or similar) containers be the right approach - i.e do a docker / s2i build with it to add in my code and have it be executed? In that case, should I simply not specify a command in the CronJob yaml, because the container is already geared to run the command I need on launch?

Yes, you don't need to specify command if one is already backed into the image through any kind of build. 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]