If you have been paying attention, then you might have noticed something interesting in the last section. We had the pets application deployed and it resulted in the fact that an instance of the web service was installed on the three nodes, node-1, node-2, and node-3. Yet, we were able to access the web service on node-1 with localhost and we reached each container from there. How is that possible? Well, this is due to the so-called Swarm routing mesh. The routing mesh makes sure that when we publish a port of a service; that port is then published on all nodes of the Swarm. Hence, network traffic that hits any node of the Swarm and requests to use a specific port will be forwarded to one of the service containers by the routing mesh. Let's look at the following diagram to see how...
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia