Skip to content
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

Having multiple upstreams for single API endpoint in Kong #1129

Closed
harryparmar opened this issue Apr 6, 2016 · 13 comments

Comments

Projects
None yet
9 participants
@harryparmar
Copy link

commented Apr 6, 2016

Hi

I have question, I want to achieve if upstream route A is down automatically forward request to Route B. Is this possible? will this be achieved with #157
Any ideas when will this be implemented?
Been testing Kong and really like it. One thing I want to point out is Runscope plugin is prominently displayed in your Quickstart but config for it is missing in Constants.lua(Docker 0.7 version). In case some one follows your guide it wont be problem till Kong is running, problem will surface on restart where Docker for Kong will show running but with no service listening on ports 8000,8001, looking at Logs show Kong is not starting because of config missing for Runscope. I had to remove from cassandra plugin table manually Runscope plugin.

@Tieske

This comment has been minimized.

Copy link
Member

commented Apr 6, 2016

@harryparmar we're working on loadbalancing and one feature is going to be healthchecks.

Regarding the runscope problem you mentioned, would you mind opening a new issue for that and include some more details for us to investigate?

@Tieske

This comment has been minimized.

Copy link
Member

commented Apr 6, 2016

just to make sure; have you seen #1079 ? Please check whether it's the same issue before creating a new one

@harryparmar

This comment has been minimized.

Copy link
Author

commented Apr 6, 2016

Hi Tieske,

I see in your github, you have already fixed constant.lua file. I pulled docker image for 0.7 which at the time(last month) was missing runscope plugin and followed your quickstart guide to install Runscope plugin which created issue on Kong restart, maybe you have already fixed the docker version too? If not i will explain the problem and fix in detail in new issue,

@jimmytoan

This comment has been minimized.

Copy link

commented Apr 7, 2016

I have written a plugin for "multiple upstreams for single API endpoint".
My idea is using Consul Server for service discovery. My plugin use Lua Resty DNS to query SRV record from Consul Server. Example:

  • My Api is running on docker container (you can run many docker containers for 1 api), all containers register their services to Consul Server (with IP and port) by using Registrator container.
  • Point domain api1.abc.com to Kong Server.
  • Enable my plugin for this api.
  • When user send request to api1.abc.com , my plugin will query SRV record of this service and receive a list of SRV records (they are round robin from Consul).
  • After that, proxy user request to the IP and port of this service.

How do you think about this?

@harryparmar

This comment has been minimized.

Copy link
Author

commented Apr 11, 2016

Jimmy that sounds very clever, thanks for sharing. when your plugin receives records from consul do they contain dead servers as well? if it does, then do you forward request to dead server or request another from Consul? my main concern is in addition to doing basic load balancing but also picking intelligently alive server to forward request to.

@gomes

This comment has been minimized.

Copy link

commented Apr 11, 2016

@harryparmar consul do health check https://www.consul.io/intro/getting-started/checks.html

@jimmypk are you planning to open your plugin?

@ahmadnassri ahmadnassri added the BC label May 13, 2016

@thibaultcha thibaultcha removed the BC label Sep 1, 2016

@gabel

This comment has been minimized.

Copy link

commented Sep 15, 2016

@jimmypk I like the idea in general the DNS communication may cause a latency overhead that may be shipped around by using consul-template to configure nginx in kong.

@FryDerm

This comment has been minimized.

Copy link

commented Jan 11, 2017

Just wondering where you stand on implementing load balancing? Is this implemented in Kong yet?

@thibaultcha

This comment has been minimized.

Copy link
Member

commented Jan 11, 2017

@FryDerm Load balancing has just started being implemented and the 0.10.0rc1 already has some capabilities regarding it (round-robin load balancing based on DNS records or manually specified "upstream targets").

See:
https://github.com/Mashape/kong/releases/tag/0.10.0rc1
#1735
Kong/docs.konghq.com#300

@FryDerm

This comment has been minimized.

Copy link

commented Jan 11, 2017

@thibaultcha Thank you very much for your response. I look forward to checking it out.

@Tieske

This comment has been minimized.

Copy link
Member

commented Feb 13, 2017

load balancing implemented in 0.10, available in the RC. Remaining is a duplicate of #112 for healthchecks. Closing this.

@Tieske Tieske closed this Feb 13, 2017

@IvanovOleg

This comment has been minimized.

Copy link

commented Feb 21, 2017

Please add a weighted routing policy to allow us to perform a Canary Releases

@Tieske

This comment has been minimized.

Copy link
Member

commented Mar 2, 2017

@IvanovOleg 0.10 also has upstream and target entities, which allow for more fine grained control. Additionally when using SRV dns records, it will use weighted round robin.

But for canary releases, traffic routing is only based on weights/volumes, not on any selection criterias (such as routing specific users or ip addresses)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.