If a service is deployed on a Docker Swarm overlay network, what IP address will containers use to communicate across nodes?
medium📝 Command Output Q5 of 15
Docker - Swarm
If a service is deployed on a Docker Swarm overlay network, what IP address will containers use to communicate across nodes?
ANo IP address is assigned; communication uses hostnames only.
BThe host machine's IP address.
CThe container's IP address assigned by the overlay network.
DThe public IP address of the Swarm manager.
Step-by-Step Solution
Solution:
Step 1: Understand container communication in overlay networks
Containers get virtual IPs from the overlay network to communicate across hosts.
Step 2: Evaluate options
The container's IP address assigned by the overlay network. correctly states containers use overlay-assigned IPs. Options A, B, and C are incorrect because communication is via container IPs, not host or manager IPs, and IPs are assigned.
Final Answer:
The container's IP address assigned by the overlay network. -> Option C
Quick Check:
Overlay network assigns container IPs for cross-node communication [OK]
Quick Trick:Containers use overlay network IPs, not host IPs [OK]
Common Mistakes:
Confusing host IP with container IP
Assuming no IP is assigned
Thinking manager IP is used for container communication
Master "Swarm" in Docker
9 interactive learning modes - each teaches the same concept differently