O'Reilly logo

Kubernetes for Developers by Joseph Heck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required