docker / docker-py

A Python library for the Docker Engine API
https://docker-py.readthedocs.io/
Apache License 2.0
6.82k stars 1.67k forks source link

Promoting/Demoting Docker Swarm Node #2459

Open jaredvacanti opened 5 years ago

jaredvacanti commented 5 years ago

When managing a docker swarm cluster using the python sdk, how should nodes be promoted or demoted to manager or worker nodes in the swarm? Does this functionality currently exist?

This is usually done before cleanup when removing a manger node, i.e. demote to worker and remove. There is currently an option to force remove using the SDK - is there a way to gracefully cleanup?

shin- commented 4 years ago

You should be able to trigger an update operation to set the role from manager to worker with: