loading...
Cover image for Kubernetes Patterns : The Cron Job Pattern

Kubernetes Patterns : The Cron Job Pattern

ahmedat71538826 profile image Ahmed Atef Originally published at magalix.com ・1 min read

Kubernetes Patterns (8 Part Series)

1) Kubernetes Patterns : The DaemonService Pattern 2) Kubernetes Patterns : The Stateful Service Pattern 3 ... 6 3) Kubernetes Patterns : The Stateful Service Pattern 4) Kubernetes Patterns : The Stateful Service Pattern 5) Kubernetes Patterns : The Cron Job Pattern 6) Kubernetes Patterns - The Batch Job Pattern 7) Kubernetes Patterns : The Reflection Pattern 8) Kubernetes Patterns : The Ambassador Pattern

My Cron Job Didn't Start On Time. What Should I Do?
In some cases, the CronJob may not get triggered on the specified time. In such an event, there are two scenarios:

We need to execute the job that didn't start even if it was delayed.
We need to execute the job that didn't start only if a specific time limit was not crossed.
In our first example, the job sends information to an API that expects this information every fifteen minutes. If the data arrives late, it's useless, and the API automatically discards it. The CronJob resource offers the. spec. startingDeadlineSeconds parameter:

.spec.startingDeadlineSeconds: If the job misses the scheduled time and did not exceed that number of seconds, it should get executed. Otherwise, it is executed on the next scheduled time.

otice that if this parameter is not set, the CronJob counts all the missed jobs since the last successful execution and reschedules them with a maximum of 100 missed job. If the number of missing jobs exceeds 100, the cron job is not rescheduled.
For More information see: https://www.magalix.com/blog/kubernetes-patterns-the-cron-job-pattern

Kubernetes Patterns (8 Part Series)

1) Kubernetes Patterns : The DaemonService Pattern 2) Kubernetes Patterns : The Stateful Service Pattern 3 ... 6 3) Kubernetes Patterns : The Stateful Service Pattern 4) Kubernetes Patterns : The Stateful Service Pattern 5) Kubernetes Patterns : The Cron Job Pattern 6) Kubernetes Patterns - The Batch Job Pattern 7) Kubernetes Patterns : The Reflection Pattern 8) Kubernetes Patterns : The Ambassador Pattern

Posted on by:

Discussion

markdown guide