<p>Im  very new to kubernetes ,here i tired a cronjob yaml in which the pods are created at every 1 minute.</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: &quot;*/1 * * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            args:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure
</code></pre>
<p>but the pods are created only after 1 minute.is it possible to run job immediately and after that every 1 minute ?</p>

june alex
<p>As already stated in the comments <code>CronJob</code> is backed by <code>Job</code>. What you can do is literally launch <code>Cronjob</code> and <code>Job</code> resources using the same spec at the same time.  You can do that conveniently using <a href="https://medium.com/@alexander.hungenberg/helm-vs-kustomize-how-to-deploy-your-applications-in-2020-67f4d104da69" rel="nofollow noreferrer">helm chart or kustomize</a>.</p>
<p>Alternatively you can place both manifests in the same file or two files in the same directory and then use:</p>
<pre><code>kubectl apply -f &lt;file/dir&gt;
</code></pre>
<p>With this workaround initial <code>Job</code> is started and then after some time <code>Cronjob</code>.
The downside of this solution is that first <code>Job</code> is standalone and it is not included in the Cronjob's history. Another possible side effect is that the first <code>Job</code> and first <code>CronJob</code> can run in parallel if the <code>Job</code> cannot finish its tasks fast enough. <code>concurrencyPolicy</code> does not take that <code>Job</code> into consideration.</p>
<p>From the documentation:</p>
<blockquote>
<p>A cron job creates a job object about once per execution time of its
schedule. We say &quot;about&quot; because there are certain circumstances where
two jobs might be created, or no job might be created. We attempt to
make these rare, but do not completely prevent them.</p>
</blockquote>
<p>So if you want to keep the task execution more strict, perhaps it may be better to use Bash wrapper script with sleep 1 between task executions or design an app that forks sub processes after specified interval, create a container image and run it as a Deployment.</p>
