Source: levelup.gitconnected.com

Understanding Jobs in Kubernetes

Category: Kubernetes, Docker, yaml

The main difference between a Job and a Cron Job is, a Job will perform a given task and once it’s completed it will stop the process and the Job runs only when we need it to run. Cron Job also does the same thing but we can schedule a Cron Job to run at a given schedule. For instance, we can schedule a Cron Job to run once every hour or we can schedule it to run at 6 am daily.

You can set the maximum number of pods you need to run for this particular job under the completions and you can define how many pods should run parallelly under the parallelism .

To verify this option we set sleep command inside our job to run it for 40 seconds.

Related Articles