<p>We have a docker container which is a CLI application, it runs, does it s things and exits.</p>
<p>I got the assignment to put this into kubernetes but that containers can not be deployed as it exits and then is considered a crashloop.</p>
<p>So the next question is if it can be put in a job. The job runs and gets restarted every time a request comes in over the proxy. Is that possible? Can job be restarted externally with different parameters in kubernetes?</p>

Serve Laurijssen
<blockquote>
<p>So the next question is if it can be put in a job.</p>
</blockquote>
<p>If it is supposed to just run once, a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/" rel="nofollow noreferrer">Kubernetes Job</a> is a good fit.</p>
<blockquote>
<p>The job runs and gets restarted every time a request comes in over the proxy. Is that possible?</p>
</blockquote>
<p>This can not easyli be done without external add-ons. Consider using <a href="https://knative.dev/" rel="nofollow noreferrer">Knative</a> for this.</p>
<blockquote>
<p>Can job be restarted externally with different parameters in kubernetes?</p>
</blockquote>
<p>Not easyli, you need to interact with the Kubernetes API, to create a new Job for this, if I understand you correctly. One way to do this, is to have a Job with <code>kubectl</code>-image and proper RBAC-permissions on the ServiceAccount to create new jobs - but this will involve some latency since it is two jobs.</p>
