I want to launch a cronjob in k8s. the equivalent crontab is :
* * * * * python3 my_script.py -p params_1.json
* * * * * python3 my_script.py -p params_2.json
* * * * * python3 my_script.py -p params_3.json
i try using cronjob but i don't know how to make the cronjob take each param_i.json in separate task.
any idea ? do i need a cronjob instance for each line above or i can manage that with just one cronjob instance ?
Thanks for your help
A Cronjob creates a Pod which can hold multiple Containers. Each Container could perform one of your tasks but they would run in parallel and maybe canceled if one Container fails (Exit Code != 0).
The best solution would either to create one Cronjob per Job you want to do or running the Jobs in one Container, one by one.