Complete the command to initialize a Docker Swarm manager node.
docker swarm [1]The docker swarm init command starts a new swarm and makes the current node a manager.
Complete the command to add a worker node to the swarm using a token.
docker swarm [1] --token SWMTKN-1-0-xyz 192.168.1.10:2377
The docker swarm join command adds a node to an existing swarm as a worker or manager.
Fix the error in the command to list all nodes in the swarm.
docker node [1]The correct command to list nodes is docker node ls.
Fill both blanks to create a service that runs on worker nodes only.
docker service create --name myservice --constraint 'node.role [1] [2]' nginx
The constraint node.role == worker ensures the service runs only on worker nodes.
Fill all three blanks to update a service to run only on manager nodes with 3 replicas.
docker service update --replicas [1] --constraint-add 'node.role [2] [3]' myservice
Setting replicas to 3 and constraint node.role == manager updates the service accordingly.
