Skip to main content

Automatically generate Docker Swarm mode node

Project description

labels for each constraint label in each
service in a Docker Compose / Docker Stack file.
Author: Sebastian Ramirez
License: MIT license
Description: ==================
Docker Auto Labels

.. image::

.. image::

Automatically generate Docker Swarm mode node labels for each constraint label in each service in a Docker Compose / Docker Stack file.

* Free software: MIT license


This command line package is made to be used with a Docker Swarm mode cluster.

It will:
* Read a Docker Compose / Docker Stack file.
* Extract the node label constraints for each service.
* Check that all the labels exist in the Docker Swarm mode cluster.
* For each label that doesn't exist, create it in a random node in the cluster.

Adding label constraints helps you ensure that all the "stateful"
Docker services (like databases) are always deployed to the same
node (specially useful in a multi-node cluster).

This program will ensure that those labels exist in one node
in the cluster, if they don't exist, they are created in one
node chosen randomly.

That way, the first time you deploy a stack, a random node will be assigned
to each stateful service (by this command, right before the deployment).

And for all subsequent deployments, the stateful services will go to the
same nodes that they were using.

For examples on how to use it, check:


This package was created with Cookiecutter_ and the `elgertam/cookiecutter-pipenv`_ project template, based on `audreyr/cookiecutter-pypackage`_.

.. _Cookiecutter:
.. _`elgertam/cookiecutter-pipenv`:
.. _`audreyr/cookiecutter-pypackage`:


0.1.0 (2018-05-01)

* First release on PyPI.

Keywords: docker_auto_labels
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docker_auto_labels-0.2.0.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

docker_auto_labels-0.2.0-py2.py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page