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:
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.
Create a firewall rule that allows traffic from 130.211.0.0/22 and 35.191.0.0/16 to reach your CoreOS host. - This is to allow traffic from the Load balancers to your containers.
Make sure that the CoreOS host belongs to an instance group.
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)
Continue configuring the host and path rules to send the traffic to the backends as you want.
Configure you frontend (and IP and optionally SSL certs)
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