<p>I have just started with Kubernetes.
I need to run a Deployment in Kubernetes with a container that competes for execution after ~10-15 minutes.
When I tried, &quot;restart Policy=Never&quot; doesn't hold true with Deployments.
Reason for opting for Deployment is to use Replicas.</p>
<p>Please provide your inputs on how I can achieve multiple replicas of my Deployment with the container that completes execution and not keep running.</p>

Sherr
<p>You can run a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/" rel="nofollow noreferrer">Job</a> as below where the container runs a <code>sleep</code> command for <code>15m</code>. After 15 minutes the container will exit and pod will be terminated.</p>
<pre><code>apiVersion: batch/v1
kind: Job
metadata:
  name: job
spec:
  template:
    spec:
      containers:
      - command:
        - sh
        - -c
        - sleep 15m
        image: bash:5.1.0
      restartPolicy: Never
</code></pre>
