I have strange behaviour related to docker swarm mode on windows. What I have done:
- Deployed two "Windows Server 2019 Datacenter with Containers - Gen1" virtual machines in Azure
- Setting RDP access from my IP to the virtual machines
- Ensures they are in the same virtual network and their subnet is associated with the virtual network
- Downloaded all windows updates
- Used telnet to check if worker machine sees master by running "telnet 10.0.0.4 3389". This works.
- Used telnet to check if master machine sees worker by running "telnet 10.0.0.5 3389". This works.
- Ensured that Docker Swarm ports are open in Windows Firefall too for both machines: 4789, 7946 (UDP) and 2377, 7946 (TCP)
- Initialized docker swarm mode on master node with the command: "docker swarm init --advertise-addr 10.0.0.4"
- Checked that "docker node ls" lists the master as Ready
- Immediately after this tried to use "telnet 10.0.0.4 3389" from worker node to see if master is still accessible - it no longer works!
- Not surprisingly, trying to join the docker swarm from the worker also fails in the usual "timeout" error
Due to the fact that telnet 10.0.0.4 3389 worked before master node entered swarm mode, but not after, it seems docker windows is doing some changes to the firewall priorities or rules, or changing the active network or something... Which is bonkers. I have not found a solution to this problem, which is making docker-for-windows unusable. Note: This problem only occurs in Azure. Using virtual machines in Exoscale and manually installing docker with powershell scripts did not show the same issue, which makes me think perhaps the "Windows Server 2019 Datacenter with Containers - Gen1" servers have some faulty configurations.
Edit:
I can confirm that this behaviour does not appear when manually installing docker for 2019 data centers using the following guide: https://blog.sixeyed.com/getting-started-with-docker-on-windows-server-2019/ (sixeyed is a known Docker for Windows expert). In other words "Windows Server 2019 Datacenter" image works.
question from:
https://stackoverflow.com/questions/65932436/docker-windows-master-node-docker-swarm-init-causes-worker-nodes-in-same-virtu 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…