<p>I will briefly describe my application workflow: I have one application (cronjob), this application read my database and I want to, based on the output from database, run a few jobs in Kubernetes. Sometimes 1 job, sometimes 10 jobs, it depends. Additionally, I would like to pass some env's to this job.</p>
<p>How Can I do that in the most proper way? Probably I should use K8s API but are there any other options?</p>

dzierzak
<p>Have you considered using Tekton?</p>
<p>Their EventListener would allow you to trigger jobs through some HTTP endpoint, and may allow you to set environment variables based on your payload.</p>
<p>See:</p>
<ul>
<li><a href="https://github.com/tektoncd/pipeline/blob/main/docs/pipelines.md" rel="nofollow noreferrer">https://github.com/tektoncd/pipeline/blob/main/docs/pipelines.md</a></li>
<li><a href="https://github.com/tektoncd/pipeline/blob/main/docs/tasks.md" rel="nofollow noreferrer">https://github.com/tektoncd/pipeline/blob/main/docs/tasks.md</a></li>
<li><a href="https://github.com/tektoncd/triggers/blob/main/docs/eventlisteners.md" rel="nofollow noreferrer">https://github.com/tektoncd/triggers/blob/main/docs/eventlisteners.md</a></li>
</ul>
