docker container switch from one node to another node without draining or restarting the node
docker container switch from one node to another node without draining or restarting the node
How to switch docker container from one node to another node without draining or restarting the node. As everytime I kill container or set docker container unhealthy , the container is started on same node. Purpose of this is to overcome frequent restart of docker on same node?
1 Answer
1
To specify a node for a container / service you need to specify a constraint docker service create --name myname --constraint 'node.hostname == dahostname' myimage
docker service create --name myname --constraint 'node.hostname == dahostname' myimage
https://docs.docker.com/engine/reference/commandline/service_create/#specify-service-constraints---constraint
and
https://docs.docker.com/engine/reference/commandline/service_update/#options
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Comments
Post a Comment