<p>I set <code>concurrencyPolicy</code> to <code>Allow</code>, here is my <code>cronjob.yaml</code>:</p>

<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: gke-cron-job
spec:
  schedule: '*/1 * * * *'
  startingDeadlineSeconds: 10
  concurrencyPolicy: Allow
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            run: gke-cron-job
        spec:
          restartPolicy: Never
          containers:
            - name: gke-cron-job-solution-2
              image: docker.io/novaline/gke-cron-job-solution-2:1.3
              env:
                - name: NODE_ENV
                  value: 'production'
                - name: EMAIL_TO
                  value: 'novaline.dulin@gmail.com'
                - name: K8S_POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
              ports:
                - containerPort: 8080
                  protocol: TCP
</code></pre>

<p>After reading docs: <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/cronjobs" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/cronjobs</a></p>

<p>I still don't understand how to use <code>concurrencyPolicy</code>.</p>

<p>How can I run my cron job concurrency?</p>

<p>Here is the logs of cron job: </p>

<pre class="lang-sh prettyprint-override"><code>☁  nodejs-gcp [master] ⚡  kubectl logs -l run=gke-cron-job

&gt; gke-cron-job-solution-2@1.0.2 start /app
&gt; node ./src/index.js

config:  { ENV: 'production',
  EMAIL_TO: 'novaline.dulin@gmail.com',
  K8S_POD_NAME: 'gke-cron-job-1548660540-gmwvc',
  VERSION: '1.0.2' }
[2019-01-28T07:29:10.593Z] Start daily report
send email:  { to: 'novaline.dulin@gmail.com', text: { test: 'test data' } }

&gt; gke-cron-job-solution-2@1.0.2 start /app
&gt; node ./src/index.js

config:  { ENV: 'production',
  EMAIL_TO: 'novaline.dulin@gmail.com',
  K8S_POD_NAME: 'gke-cron-job-1548660600-wbl5g',
  VERSION: '1.0.2' }
[2019-01-28T07:30:11.405Z] Start daily report
send email:  { to: 'novaline.dulin@gmail.com', text: { test: 'test data' } }

&gt; gke-cron-job-solution-2@1.0.2 start /app
&gt; node ./src/index.js

config:  { ENV: 'production',
  EMAIL_TO: 'novaline.dulin@gmail.com',
  K8S_POD_NAME: 'gke-cron-job-1548660660-8mn4r',
  VERSION: '1.0.2' }
[2019-01-28T07:31:11.099Z] Start daily report
send email:  { to: 'novaline.dulin@gmail.com', text: { test: 'test data' } }
</code></pre>

<p>As you can see, the <strong>timestamp</strong> indicates that the cron job is not concurrency.</p>

<p>It's because you're reading the wrong documentation. CronJobs aren't a GKE-specific feature. For the full documentation on CronJob API, refer to the Kubernetes documentation: <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#concurrency-policy" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#concurrency-policy</a> (quoted below).</p>
<p>Concurrency policy decides whether a new container can be started while the previous CronJob is still running. If you have a CronJob that runs every 5 minutes, and sometimes the Job takes 8 minutes, then you may run into a case where multiple jobs are running at a time. This policy decides what to do in that  case.</p>
<blockquote>
<h2>Concurrency Policy</h2>
<p>The .spec.concurrencyPolicy field is also optional. It specifies how to treat concurrent executions of a job that is created by this cron job. the spec may specify only one of the following concurrency policies:</p>
<ul>
<li><code>Allow</code> (default): The cron job allows concurrently running jobs</li>
<li><code>Forbid</code>: The cron job does not allow concurrent runs; if it is time for a new job run and the previous job run hasn’t finished yet, the cron job skips the new job run</li>
<li><code>Replace</code>: If it is time for a new job run and the previous job run hasn’t finished yet, the cron job replaces the currently running job run with a new job run</li>
</ul>
<p>Note that concurrency policy only applies to the jobs created by the same cron job. If there are multiple cron jobs, their respective jobs are always allowed to run concurrently.</p>
</blockquote>
