Tutor plugin to create k8s cronjobs?

is it possible to create a tutor plugin that generates a k8s cronjob running on either lms/cms? if not, can anyone provide guidance on how i could programatically determine the k8s pod/service names for purposes of dynamically creating an lms/cms cronjob in k8s?

Of course it’s possible! Though I’m not sure how exactly you would do that. How would you implement that if you wanted to run a regular, non-Open edX-related cron job in Kubernetes? I suspect you would create a CronJob object, right?

yes, that is correct, i’d created a CronJob, substantially duplicating the information found in the lms/cms deployment manifests, the key things being:

  • image
  • environment settings
  • volume mounts
  • resource requests and pull policy

since tutor already knows all of these things, it would be ideal, and more consistent, if i could create said CronJob from the tutor command line.

It should be easy enough to add this CronJob to the existing manifests by creating a Tutor plugin that implements the k8s-override patch.

I understand that there is a lot of duplicate information in manifests… but unfortunately that’s the state of things within the kustomize world.

ahhhh!!! that is new for me, but looks like exactly what i need. thanks!!!