<p>I have a simple cronjob that runs every 10 minutes:</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: myjob
spec:
  schedule: &quot;*/10 * * * *&quot; #every 10 minutes
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: job
            image: image
            imagePullPolicy: Always
          restartPolicy: OnFailure
</code></pre>
<p>It indeed runs every 10 minutes, but i would like it to run first time when i deploy the cronjob. is it possible?</p>

<p>You could have a one time CronJob trigger the scheduled CronJob:</p>
<pre><code>kubectl create job --from=cronjob/&lt;name of cronjob&gt; &lt;name of job&gt;
</code></pre>
<p><a href="https://www.craftypenguins.net/how-to-trigger-a-kubernetes-cronjob-manually/" rel="nofollow noreferrer">Source</a></p>
<p>The one time CronJob would need to run after the scheduled CronJob has been created, and its image would need to include the kubectl binary. Api-server permissions needed to run kubectl within the container could be provided by linking a ServiceAccount to the one time CronJob.</p>
