Running very lightweight tasks periodically with kubernetes

5/28/2020

Consider a requirement where we need to run very simple and lightweight tasks , say running curl command every 10 minutes.

If this was to run in a kubernetes cluster , is it efficient to create a container every 10 minutes ? Just to execute a task that may take a few seconds or even millisecond ? Is it an overkill from time and cost angle ?

Please note unfortunately lambda functions or cloud functions is not an option.

-- John Smith
kubernetes

1 Answer

5/28/2020

You can use a CronJob to run Jobs on a time-based schedule. These automated jobs run like Cron tasks on a Linux or UNIX system. Cron jobs are useful for creating periodic and recurring tasks.

https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/

-- Arghya Sadhu
Source: StackOverflow