Kubernetes includes support for one-off (also known as batch) computation work, as well as supporting common use cases for asynchronous background work. In this chapter, we look at the Kubernetes concept of job, and its neighbor, CronJob. We also look at how Kubernetes handles and supports persistence, and some of the options that are available within Kubernetes. We then look at how Kubernetes can support asynchronous background tasks and the ways those can be represented, operated, and tracked by Kubernetes. We also go over how to set up worker codes operating from a message queue.
Topics covered in this chapter include:
- Job
- CronJob
- A worker queue example with Python and Celery
- Persistence with Kubernetes
- Stateful Sets
- Custom Resource Definitions (CRDs)