<p>I'm currently trying to deploy a backend service API for my application in Openshift, which needs to be scalable such that each of the request has to run in a new pod.</p>

<p>Service will take 5 minutes to serve single request.
I have to hit the service for 700 times.</p>

<p>Is there a way I can create 700 pods to serve the 700 request and scaled down it to 1 after all the requests are completed ?</p>

<p>Start of the application:
1 pod &lt;- 700 requests</p>

<p>Serving:
700 pod serves one request each</p>

<p>End of the application:
1 pod</p>

Raja Ayyavu
<p>Autoscaling in Kubernetes relies on metrics. From what I know Openshift supports <a href="https://docs.openshift.com/container-platform/3.7/dev_guide/pod_autoscaling.html#hpa-supported-metrics" rel="nofollow noreferrer">CPU and Memory utilization</a>.</p>

<p>But I don't think this is what you are looking for.</p>

<p>I think you should be looking into <a href="https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/" rel="nofollow noreferrer">Jobs - Run to Completion</a>.</p>

<p>Each request will spawn a new <code>Job</code> which will run until it's completed.</p>

<p>Example:</p>

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

<p>This will run a job which computes π to 2000 places and prints it out.</p>
