-
Notifications
You must be signed in to change notification settings - Fork 616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route based on ports #94
Comments
Not right now. You can configure multiple listeners but the routing table is shared among them and routing is currently done only via |
@magiconair Thanks :) |
@skyrocknroll do not use ports for micro-services, is a nightmare with proxies and firewalls, better use paths or subdomains. if prefer subdomains using a wildcard domain and wilcard ssl. |
+1 for this idea. In my case, I might separate HTTP and HTTPS for different backend, for example:
For API server, i don't want it exposed via HTTP. in mean time to workaround this, i create TWO fabio containers and use different prefix |
see #90 |
@skyrocknroll what you could do is to run one fabio per port and use different tag prefixes but that is pushing fabio a bit beyond of what it is currently designed to do. You certainly lose the ability to just route to a new service without configuration since you have to spin up a fabio instances for that new port. I'd go with @mazhack that using static ports for incoming requests is not a good idea. Use different URLs instead but that might not be possible for you. |
Fantastic work on the project @magiconair! I wanted to see if there were any new considerations for this request (routing based on ports) after HashiConf EU 2016. Kelsey mentioned running Fabio as a system service on all nodes of a Nomad cluster to stabilize the ports registered with upstream load balancers (ELB, etc). Host and/or path-based routing makes total sense when the requested host names are stable. However, some of our edge applications use the requested subdomain for multi-tenancy purposes (possibly via CNAME in the future), so port-based routing into a particular application seems like the safest way to go. Right now, we run EC2 instances behind ELBs for edge applications on static ports (8080 and up) and there is an ELB for each application. The rate of change on the applications and their ports is extremely low, so I was looking at consul-template for I'll detail a scenerio I tried below in case I misunderstood something. A web application needs to respond to An ELB for this application is listening on port 80 and sending all traffic to registered EC2 instances on 8085 where Fabio is listening:
The application is running on port 30000 on one of the instances and would register with consul with the following:
The fabio UI shows host = :8085 and path = / as expected. However, routing doesn't work as I think we are discussing in this issue:
|
@stevenscg How is the link between |
Also, I'm starting to think that a different matcher implementation (with some small refactoring) might be a solution to this instead of waiting for the full tag prefix refactor. The |
The ELB makes the request to port 8085 on the instance(s). So, I believe that Fabio would see the request as coming in on port 8085 and be able to use it in decision making. I picked 30000 just as an example of a random unprivileged port that Nomad or raw docker might select for the app.
|
@stevenscg So the ELB has the |
Yes, exactly! I haven't worked through it yet, but should be able to do rolling updates with nomad or Ansible on the rare occasions when the apps or listener ports need to change. TBH, we have always assigned a 8000-series port for internal/dev use when we create a new service and haven't had to make any changes to those edge applications. Happy to test and/or write up more examples with/without Fabio in the architecture if that helps.
|
@magiconair curl -X PUT -d '{"ID": "redis31","Name": "redis31","Tags": ["primary31","v31"],"Address": "172.168.11.16","Port": 9190,"EnableTagOverride": false, "Check":{"id": "Health31","name": "Health31","http": "http://172.168.11.16:9190/website/login","interval": "5s","timeout": "2s"}}' http://127.0.0.1:8500/v1/agent/service/register curl localhost:8500/v1/health/state/any?pretty and i start fabio by default: 2017/01/10 19:23:05 [INFO] Version 1.3.5 starting and now I do not how to access my service by fibio proxy, the origin service url is: http://172.168.11.16:9190/website/login I read the doc of fibio github, but i can not understand what the means, what is urlprefix? how to add to my url. thank you very much! |
hi @magiconair is the feature to be able to create listeners dynamically available yet ? We use fabio as an ingress router for our services that require tcp based ingress, its kind of implemented in a way that for every new service that needs tcp ingress, an instance of fabio is brought up, the tcp requests are routed via the fabio instance. There is also the concern of the cpu that the fabio instances are using, with the number of instances increase, the cpu shares although set to 0.1 cores, the usage seems to be at an average of 1.4% when idle ( no request activity). This seems to be overloading the host and the consul process running on it. Although this is a separate ticket that we would create for the cpu usage concern, it'd help if we could run a single instance and just bring up multiple listeners. CC: @samart |
@sriyer No, this hasn't been implemented yet and I don't have the bandwidth to do the refactoring. My guess is that the activity comes from fabio checking consul in the background. If you configure fabio manually anyway you might want to disable that to see whether that helps. |
Hi ,
We have multiple micro services , Each microservice is running in multiple nodes. Is it possible to configure fabio to listen on one port per microservice ? Then whatever request comes to that port will be sent the corresponding microservice in a loadbalanced manner.
Ex:
port 9999 : authservice running on 10.0.0.1,10.0.0.2
port 7888 : usermanagement running on 10.0.1.1,10.0.1.2
The text was updated successfully, but these errors were encountered: