Open VietND96 opened 7 months ago
This issue is looking for contributors.
Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.
@VietND96 I would like to take this up and need some more info. Can you explain more about what type of cronjob needs to be added? Do we want a customizable cronjob that can execute tasks defined by the user?
Hi @navin772, thanks for your interest Actually, the cronjob would be generic, the context I mentioned above is one of the scenarios. For example, the user compose a Bash script to do something, and this script will be added to a K8s CronJob resource
@VietND96 how do we want to pass the custom script to the cronjob?
We can either have volume mounts via hostPath
or configMaps
. Configmaps are a better option IMO.
Let me know what you think!
Feature and motivation
There was a discussion around "programmatic solution for killing orphaned sessions after a test suite runs" The orphaned session could be understood as
And there was solution with a script and schedule run in a pipeline, something like
Instead of the pipeline, in Kubernetes has a component CronJob to schedule a task run itself based on cron we set. Add to chart template for CronJob, which executes a shell script implemented, then everyone can simplify inserting their custom scripts for different tasks there.
Usage example
https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/