We are writing a package delivery tracker application using Kubernetes/go-lang. Everything's fine until we've reached a road block where we have certain scheduling needs, and couldn't figure out what to use. The use case is:
- Once a package is assigned and out for delivery, its location should be tracked.
- If the package is not assigned after 3 hours of reaching the warehouse, we should mark it as "delivering tomorrow".
- Some usual cron-type jobs.
for #1 we are planning to schedule a job which will poll the location of package after every 10 seconds. But this is a one time job. Once the package has been delivered. It should die out.
for #2 we are planning to schedule a timed/cron job which will be triggered by our API. This job will be scheduled for 3 hours after the receipt of package at warehouse.
Our #3 above is a usual cron-job for various internal purposes.
We want to use a single scheduling platform to serve all these type of requirements.
Since we are using Kubernetes exclusively, we want to leverage it's job scheduling functionality. But we have certain doubt about it.
- Can we create these jobs from our source code ? It is possible as mentioned here. But I am not sure whether our system administrator would allow us to do that.
I've read about work queues in Kubernetes, where we can push our jobs to a work queue and a consumer will create jobs for these work items.
But, I am unaware of how to create a permanent consumer daemon for that work queue, which will poll that queue and create jobs for each work item.
Another doubt is how to schedule simple cron jobs(#3 above) here.
I've also heard about Kala, but not sure how will this fit in Kubernetes world.
Any reference, pointers, links or suggestions would be highly appreciated as I am pretty new to Kubernetes/Golang in general, and not finding anything concrete on google as well.