Hi,
We have a k8s charm that we’re working on which requires a recurring task to be run and it seems there are a few different options (and probably more we haven’t thought of):
- Installing and configuring
cron
in the workload container to run the recurring task. - Talking to the k8s API to configure a kubernetes cronjob (although that restricts us to tasks that would be executed in separate pods from our workload).
- Using pebble to start a long running process that runs the task with the frequency required.
- Triggering off an
update-status
hook and running the task based on this (would mean you could only do so as frequently asupdate-status
is configured for the model in question).
Has anyone else come across this already and have any recommendations/best practices for approaching the problem?
Thanks, Tom