<p><a href="https://i.stack.imgur.com/6b3fx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6b3fx.png" alt="enter image description here" /></a></p>
<p>Is this diagram correct? Because, activeDeadlineSeconds takes precedence over backOffLimit, if activeDeadlineSeconds exceeded it should directly mark the job as incomplete right? Why is this checking backOffLimit if activeDeadlineSeconds exceeded?</p>

Vasu Youth
<p>The two parameters serve different purposes. In most cases  <strong>ActiveDeadlineSeconds</strong> takes <strong>precedence</strong> over <strong>backoffLimit</strong> because <strong>activedeadline</strong> is a hard limit on the <strong>amount of time</strong> that an operation is allowed to take. If <strong>activeDeadlineSeconds</strong> exceeds then all the pods will <strong>terminate</strong> and mark the job as <strong>failure</strong> with <strong>reason: DeadlineExceeded</strong>. Whereas the <strong>backofflimit</strong> is a limit on the <strong>number of tries</strong> that are attempted. However the specific precedence will depend on the <strong>implementation</strong> of the API or <strong>application system</strong>, as different systems may <strong>prioritize</strong> these parameters differently.</p>
<p>The scheduling of <strong>cronjobs</strong> will be as follows</p>
<ol>
<li>On <strong>scheduling</strong> a cron job.</li>
<li>It will create a normal <strong>job</strong>.</li>
<li>Job will create a Pod.</li>
<li>If Pod has <strong>Error</strong> it will check whether the <strong>backoffLimit</strong> is exceeded
or not.</li>
<li>If Yes, then it will mark the job as <strong>incomplete</strong>.</li>
<li>If No, then it will check if the <strong>activeDeadlineSeconds exceeded</strong> or
not.</li>
<li>If <strong>activeDeadlineSeconds does not exceed</strong> then the job is marked as
complete.</li>
<li>If it is <strong>exceeded</strong> then it will <strong>mark as failure with reason
DeadlineExceeded</strong>.</li>
</ol>
<p>For more information refer to this <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/#job-termination-and-cleanup" rel="nofollow noreferrer">official k8 document</a></p>
