junioralm
(Junioralm)
September 25, 2024, 1:54pm
1
I have a machine in AWS and another in ORACLE, both part of a Swarm, and both are managers.
I created an overlay network my_net
, then I created 2 services:
docker service create --name ngx0 --network my_net -p 8080:80 nginx
(ORACLE)
docker service create --name ngx1 --network my_net -p 8888:80 nginx
(AWS)
I entered the aws service (ngx1) and tried curl ngx1
and it worked normally, but I tried curl ngx0
which would be the one from oracle, and it didn’t work, the same happens in oracle, there curl ngx0
works and curl ngx1
does not
docker network inspect my_net, in aws machine
docker network inspect my_net, in oracle machine
meyay
(Metin Y.)
September 25, 2024, 6:46pm
2
I am afraid you will have to provide way more details about how your setup looks like, what you did and why expect it to work.
bluepuma77
(Bluepuma77)
September 25, 2024, 6:59pm
3
Does docker node ls
show both nodes connected? How did you create the overlay network?
junioralm
(Junioralm)
September 25, 2024, 7:29pm
4
and I just create with docker network create -d overlay my_net
junioralm
(Junioralm)
September 25, 2024, 7:32pm
5
alright, what do you need?
meyay
(Metin Y.)
September 25, 2024, 7:37pm
6
Everything required to get an understanding of why this should work. Basically what’s the exact difference between you setup, compared to a setup where the nodes are in the same subnet of a low latency network.
junioralm
(Junioralm)
September 25, 2024, 7:49pm
7
I ran these commands above. With the two services, ngx0 in aws and the ngx1 service in oracle for example, both on the same network overlay, if I enter one of the containers, and curl on the name of the service I connected to, it works normally, but when I try to curl the name of the opposite service, it doesn’t work
meyay
(Metin Y.)
September 25, 2024, 7:55pm
8
If the nodes were in the same private subnet, those commands indeed would be enough, but that’s not your use case, is it?
Please don’t make us guess how your setup looks like, or make us ask about things you should know.
junioralm
(Junioralm)
September 25, 2024, 7:57pm
9
Shouldn’t I be able to communicate with the other service, from another node, just by using its service name?
meyay
(Metin Y.)
September 26, 2024, 6:05am
11
What I expected you to share as part of your first post are details like:
Do the compute nodes use public or private ip’s?
In case of private how did you connect the networks?
How are the security groups configured?
Even if they run with public ips (which is a security no-no!), you must have at least configured security groups.
junioralm
(Junioralm)
September 26, 2024, 11:54am
12
That’s what I did:
just create 2 machines, 1 in aws and 1 in oracle, after that I follow docker’s guide to open the recommended ports: (all for this 0.0.0.0/0)
Finally, I connect both to the swarm, then I run the test of this related post
bluepuma77
(Bluepuma77)
September 26, 2024, 1:20pm
13
Try to create a global service:
docker service create \
--name whoami \
--mode global \
--network my_net \
traefik/whoami
Then check if it’s running on all nodes:
docker service ps whoami