<p>I have sample k8s job as soon as you do kubectl apply the job gets triggered and the pods are created . How to control the pod creation?</p>

<pre><code>apiVersion: batch/v1
kind: Job
metadata:
  name: pi-with-timeout
spec:
  backoffLimit: 5
  activeDeadlineSeconds: 100
  template:
    spec:
      containers:
      - name: pi
        image: perl
        command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
      restartPolicy: Never
</code></pre>

krishnanand nb
<p>If you want to manually control the pod creation, you can achieve it through parallelism.</p>

<p>Documentation says:</p>

<blockquote>
  <p>The requested parallelism (.spec.parallelism) can be set to any non-negative value. If it is unspecified, it defaults to 1. If it is specified as 0, then the Job is effectively paused until it is increased.</p>
</blockquote>

<p>You can set it to 0 while doing the <code>kubectl apply</code>. Configuration looks something like below</p>

<pre><code>apiVersion: batch/v1
kind: Job
metadata:
  name: pi-with-timeout
spec:
  backoffLimit: 5
  parallelism: 0
  activeDeadlineSeconds: 100
  template:
    spec:
      containers:
      - name: pi
        image: perl
        command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
      restartPolicy: Never
</code></pre>

<p>You can set it to 1 whenever you decide to run.</p>
