I'm unsure of how to setup DNS for a coreos cluster.

Currently I have all of my api instances behind a haproxy load balancer and a DNS A record which points to the (elastic) ip of the load balancer. So I can send traffic to api.myapp.com and it gets routed to an api instance. This works fine but obviously the load balancer is a single point of failure.

If I move into setting up a cluster using coreos and the cluster is running multiple services-not just the api service- how do I point api.myapp.com to the cluster in the same way as I do currently, but ensure that any requests sent using this address are somehow routed only to the api service inside the cluster? This is something not clear to me from reading many tutorials on coreos.

  • 1
    Did you find an answer in the end? – artemave Mar 14 '15 at 17:37

You'll need to run a routing layer (HAproxy should work fine) that is directing traffic based on HTTP host header. Run this routing container on a few machines bound to 80/443 as desired. Add A records for each of your services that point to these few machines. Your LB is now highly available.

Next, set up your HAproxy routing rules to consume the location of your downstream services and route traffic appropriately. For example, a request to api.example.com gets routed to either, or The router ( sees it has two backend containers responsible for api.example.com running on and The traffic is routed to one of the containers and the request is fulfilled.

A full example of this with Vulcan proxy and etcd is here: https://coreos.com/blog/zero-downtime-frontend-deploys-vulcand/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.