<p>I'm using <code>activeDeadlineSeconds</code> in my <code>Job</code> definition but it doesn't appear to have any effect. I have a CronJob that kicks off a job every minute, and I'd like that job to automatically kill off all its pods before another one is created (so 50 seconds seems reasonable). I know there are other ways to do this but this is ideal for our circumstances.</p>

<p>I'm noticing that the pods aren't being killed off, however. Are there any limitations with <code>activeDeadlineSeconds</code>? I don't see anything in the documentation for K8s 1.7 - <a href="https://v1-7.docs.kubernetes.io/docs/api-reference/v1.7/#jobspec-v1-batch" rel="nofollow noreferrer">https://v1-7.docs.kubernetes.io/docs/api-reference/v1.7/#jobspec-v1-batch</a> I've also checked more recent versions.</p>

<p>Here is a condensed version of my CronJob definition - </p>

<pre><code>apiVersion: batch/v2alpha1
kind: CronJob
metadata:
  name: kafka-consumer-cron
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:  # JobSpec
      activeDeadlineSeconds: 50   # This needs to be shorter than the cron interval  ## TODO - NOT WORKING!
      parallelism: 1
      ...
</code></pre>

<p>You can use <code>concurrencyPolicy: "Replace"</code>. This will terminate previous running pod then start a new one.</p>

<p>Check comments from here: <a href="https://github.com/kubernetes/api/blob/b7bd5f2d334ce968edc54f5fdb2ac67ce39c56d5/batch/v1beta1/types.go#L108" rel="nofollow noreferrer">ConcurrencyPolicy</a></p>
