I try to deploy a docker swarm cluster on two virtual machines in google cloud project. However i am facing some networking problems.
It seems that inter-service connectivity does not work.
A Redis client container from manager cannot connect to Redis server container on worker.
Do i have to enable any specific configuration in firewall rules?
So both VMs in your swam are within the same GCP project? Are they deployed to the default VPC? If they are, there should be a firewall rule called default-allow-internal that allows internal communication between VMs.
If they're not deployed on the default VPC, you may have want to have that rule created for your custom VPC.
Are you connecting from client to server via internal IP or external IP? Because that firewall only covers internal traffic.
Yes they are connected to the same network. When i try to connect using Redis cli command from manage to worker, it works. The problem is only when i try it from inside the docker. I just saw that the problem exists only for Redis docker. I ran a similar test for nginx and it works.
That sounds like a possible config issue. What does your redis.conf look like? I think there's a binding param in there that sets what interface it listens for connections on.
Eventually i found the problem. It is an issue with the kernel of Ubuntu 20.04. I created a new swarm cluster with Ubuntu 18.04 and it works.
Thank you @glen_yu