Networking for docker swarm

Format: Plaintext
 ( View Raw)
Date: Sat, 09 Nov 2024 at 20:18:14

$ docker stack ps nginx
ID             NAME          IMAGE                                     NODE      DESIRED STATE   CURRENT STATE          ERROR     PORTS
8cbba9ltp9qn   nginx_app.1   ilmuflone/muflone-rendered:2024-11-09.2   cloud7    Running         Running 19 hours ago             


$ docker service inspect nginx_app | grep 'Addr":'
                    "Addr": "10.0.0.64/24"
                    "Addr": "10.0.3.82/24"

$ docker inspect nginx_app.1.8cbba9ltp9qnliezjzuzmau0s | grep 'IPAddress":'
            "IPAddress": "",
                    "IPAddress": "10.0.0.4",
                    "IPAddress": "10.0.3.5",

$ docker exec -it nginx_app.1.8cbba9ltp9qnliezjzuzmau0s ip addr show eth1
35: eth1@if36: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1450 qdisc noqueue state UP 
    link/ether 02:42:0a:00:03:05 brd ff:ff:ff:ff:ff:ff
    inet 10.0.3.5/24 brd 10.0.3.255 scope global eth1
       valid_lft forever preferred_lft forever