DevOps Tools Engineer (LPIC-OT 701) — Question 46
What statement is true regarding the Swarm service created by the following command? docker service create --name myweb --network webnet --mode global nginx
Answer options
- A. It runs exactly one time in the Swarm and cannot be scaled.
- B. It runs exactly once on each node in a Swarm.
- C. It runs on one node by default and can be scaled to an arbitrary number of replicas.
- D. It runs on all nodes which provide the network webnet.
- E. It runs only on those nodes which support the network type global.
Correct answer: B
Explanation
The correct answer, B, is true because the --mode global setting specifies that the service will run one instance on each node in the Swarm. Option A is incorrect as the service runs multiple instances, one per node. Option C is also wrong because it does not run on a single node by default but rather on all nodes. Option D is misleading since it doesn't just run on nodes providing the network but on all nodes regardless of network. Option E is incorrect as global mode doesn't depend on network type compatibility.