<p>I have to deploy a <strong>Cronjob in Kubernetes</strong> that will create a Job pod every 15 minutes. The job will check if a service is ready to provide new data. Once this service is ready, the job will take more than 1 hour to complete its execution. The problem revolves around the fact that other jobs are going to be executed during this time.</p>

<p>In short, how can I prevent a job to be executed in <strong>Kubernetes Cronjobs</strong> when there's already a Job running? </p>

d4nielfr4nco
<p>CronJob resource has a property called <code>concurrencyPolicy</code>, here an example:</p>

<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: your-cron
spec:
  schedule: "*/40 8-18 * * 1-6"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app: your-periodic-job
        spec:
          containers:
          - name: your_container
            image: your_image
            imagePullPolicy: IfNotPresent
          restartPolicy: OnFailure
</code></pre>
