Reputation: 667
I'm planning to use docker swarm mode for my applications to host. Currently in a situation to figure out a way of integrating F5 load balancer with docker swarm mode service discovery. Is there a use case to achieve this? I know we can publish the ports with host and route traffic to host ip from F5 but that will limit me to run just task per host.
Could I use Consul as service discovery and have the hostnames for the services so I will have a bind dns setup to forward dns requests to consul?
Suggestions/Idea's are much appreciated.
Thanks in advance.
Upvotes: 0
Views: 1545
Reputation: 670
Without knowing more about your intended application, if I was using Service Discovery VIPs rather than DNSRR, I would treat each advertised VIP as the node behind the BIG-IP VIP. That way, you can use BIG-IP's iControlREST to add/modify/delete nodes as they're spun up in Swarm's Service Discovery.
Curl example: curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST https://x.x.x.x/mgmt/tm/ltm/pool -d '{"name":"test-pool","members":[{"name":"Server-Bob:443","address":"10.0.0.1"}]}'
Using the above idea, you would have a published application via the BIG-IP, and you would add/remove docker service discovered VIP's on the fly via Ansible/Python/Whatever.
You could use Consul for service discovery but I think you'd be creating redundant functions since Swarm can complete the similar discovery tasks. Adding Bind DNS requirements wouldn't make management that much easier. Technically there's a lot of ways you could do this but that way makes the most sense to me if you already have established BIG-IP infrastructure. If I am missing something in your application requirements let me know and I can modify my answer.
Upvotes: 0