0

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.

Moreover, I run my Kubernetes Cluster on GCP (Autopilot) so I don't want to have any pod running all the time. So EventListener in Tekton is not a good option since Kubernetes service running the sink logic inside a dedicated Pod.

How Can I do that in the most proper way? Probably I should use K8s API but are there any other options?

1 Answer 1

1

The standard way to achieve this would be to provide the rights to create pods, to the service account provided to the cronjob pod.

Then make calls to the Kubernetes API from inside the pod, using kubectl or programatically using a library that can interface with the k8s API.

2
  • I was thinking about this, but I hoped there is the simpler solution. Thank you for answer.
    – dzierzak
    Nov 13, 2021 at 10:13
  • @dzierzak the sequentially is not part of the nature of K8s declarative fashion, while it provides some notion, for this you would need another layer to do this, for example Argo Workflows would be a perfect match for this. Mar 7, 2023 at 15:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .