<p>I'm kinda new to Kubernets and I think I understand the basics of the whole system but most of the stuff I have read was about how to use kubectl to start a service and deployment and stuff.</p>

<p>But in my use case I have this web API running (built in ASP.net core) that takes a request, does some processing and depending on the input data has to start a secondary process.</p>

<p>A Kubernetes job with restart policy OnFailure seemed to be the way to implement those secondary processes but I can't find any resources on how the web server can be used to start this job.</p>

Jurgy
<p>You can use Kubernetes API to create a Job(or any kubernetes resource) from your application running inside the cluster. You can either install <code>kubectl</code> inside your applications's container and call it from your application code or use a kubernetes client library(<a href="https://github.com/kubernetes-client/csharp" rel="nofollow noreferrer">https://github.com/kubernetes-client/csharp</a>) to talk to kubernetes API server. </p>

<p>See the following answer for more details:</p>

<p><a href="https://stackoverflow.com/questions/59682162/kubernetes-finding-out-how-many-replicas-there-are-in-a-service/59682581#59682581">Kubernetes - Finding out how many replicas there are in a service?</a></p>
