Seeing as CoreOS is designed to run docker containers, I was wondering if there's a way to map Backend Services on a HTTP Load Balancer directly to Docker Images running on a single CoreOS instance.

This is the structure I'm going for:

www.example.com/marketing -> docker:marketing-app
www.example.com/accounts -> docker:accounts-app
www.example.com/ -> docker:www-app

I know this can be done with Kubernetes using Ingress - each docker container will be seen as a backend service by the HTTP Load Balancer, this is ultimately what I'll be using for production; for my test/qa/demo setup, I'm looking for something much simpler, a single large CoreOS instance, running multiple docker containers and have the exact same HTTP Load Balancer (that will later be used in prod) point to docker containers on the CoreOS instance.

Does CoreOS have such functionality?

If not, what other options do I have other than starting an NGINX container to route all traffic from the HTTP Load Balancer to different containers?


In GCP L7 LBs you've:

LB Frontend >> LB Backend >> Instance group >> Instance >> port

So, all the hard work happens on the load balancer.

The steps to get what you want are:

  1. Make sure that every container has tits own port exposed on the host machine (CoreOS) and that the services you want expose are accessible over those ports.

  2. Create a firewall rule that allows traffic from and to reach your CoreOS host. - This is to allow traffic from the Load balancers to your containers.

  3. Make sure that the CoreOS host belongs to an instance group.

  4. Go ahead and configure your LB backends (Edit the LB config). Add a new backend service per container running on the CoreOS instance, specifying its port. (here is where you associate each container with a different backend)

  5. Continue configuring the host and path rules to send the traffic to the backends as you want.

  6. Configure you frontend (and IP and optionally SSL certs)

  7. Give it 5 mins to build up and test your stuff. You're done!

Once you understand how it works it's really easy to manage.

See https://cloud.google.com/compute/docs/load-balancing/http

  • Didn't know you could specify ports on the instance groups, very cool!! – Jan Vladimir Mostert Mar 1 '18 at 16:20

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.