none
Changing the docker network peers IP's RRS feed

  • Question

  • We recently added a NIC to each of our docker host machines.  So at the moment there are 2 nics per host.   1 of the nics is a private NIC/IP dedicated to F5 load balancing traffic and the other for general machine IP traffic.

    How can I have the swarm mode management listening on the regular machine IP and the applications listening on the F5 private NIC.

    Is that possible?


    • Edited by LanceLyons Monday, October 14, 2019 3:55 PM
    Friday, October 11, 2019 9:11 PM

All replies

  • I have tried to recreate the swarm using these commands

    making some assumptions

    HOST 1      IP 1    10.0.0.1      IP2 (private f5 ip)  10.0.20.1

    HOST 2      IP 1    10.0.0.2      IP2 (private f5 ip)  10.0.20.2

    docker swarm init --advertise-addr=10.0.0.1 --listen-addr 10.0.0.1:2377 --data-path-addr 10.0.20.1 

    then on the HOST 2

    docker swarm join -data-path-addr 10.0.20.2  --token SWMTKN-1-29j4ahhylc7mls2hvogsdwksx7kofiog62r7cwsfczztobivnf-2y6i9ukkbs97vxyv6193m62kh 10.0.0.1:2377

    then i create a network       docker network create --driver overlay olhnetwork

    then start up 2 services.

    docker service create --network=olhnetwork --name AuthService --replicas 2 --publish 8090:80  authservice:latest

    docker service create --network=olhnetwork --name ClientPortal --replicas 2 --publish 8080:80  clientportalwconfigs:latest

    then do a     docker network inspect  olhnetwork

    and the networks defined peers are still   

            "Peers": [
                {
                    "Name": "1e1e93f7215b",
                    "IP": "10.0.0.2"
                },
                {
                    "Name": "ee7d63cae056",
                    "IP": "10.0.0.1"
                }
            ]

    How can I force the management to be on the 10.0.0.1/10.0.0.2 addresses but have the application listening on 10.0.20.1/10.0.20.2?

    Is this possible?

    Tuesday, October 15, 2019 7:59 PM