# Set drs placement rules ( Constraints)
#Add a Label to Node:
docker node update –label-add key=data nodename

docker node update –label-add region=east worker-1
docker node update –label-add datacenter=tp-chassis1 swarm100
docker node update –label-add datacenter=tp-chassis1 swarm101
docker node update –label-add datacenter=tp-chassis2 swarm102

#removing labels
docker node update –label-rm datacenter=tp-chassis1 swarm100
docker node update –label-rm datacenter=tp-chassis1 swarm101
docker node update –label-rm datacenter=tp-chassis2 swarm102

# Create mcd as service task
docker service create –name mcd_drs –constraint node.labels.datacenter==tp-chassis1 –replicas 3 nginx
or 

Create new Stack 
docker stack deploy –compose-file docker-compose.yml <name>

# Existing nodes
docker service update papajones_wordpress –constraint-add node.labels.datacenter==tp-chassis1

#Scaling nodes
docker service scale plumtomato_wordpress=10
 

(Visited 53 times, 1 visits today)

By C A Thomas

Chinchu A. Thomas is an Infrastructure Analyst specializing in Microsoft Azure, the Microsoft 365 suite, AWS, and Windows infrastructure management products.

Leave a Reply