Celery worker

To create a worker, we made our own container image very similar to the Flask container. The Dockerfile uses Alpine Linux and explicitly loads Python 3 onto that image, then installs the requirements from a requirements.txt file and adds in two Python files. The first, celery_conf.py, is the Python definition for a couple of tasks taken directly from the Celery documentation. The second, submit_tasks.py, is a short example that is meant to be run interactively to create work and send it over the queue. The container also includes two shell scripts: run.sh and celery_status.sh.

In all of these cases, we used environment variables that we source from the preceding ConfigMap to set up the logging output from the worker, as well ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.