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

Kongserver 0.10.0 version, the use of the problem #1980

Closed
taojinxin opened this issue Jan 13, 2017 · 8 comments
Closed

Kongserver 0.10.0 version, the use of the problem #1980

taojinxin opened this issue Jan 13, 2017 · 8 comments

Comments

@taojinxin
Copy link

taojinxin commented Jan 13, 2017

Very grateful to 0.10.0RC version, I decided to test this version of the function. However, the following two questions:

  1. 0.10.0 version of the API add the way, and 0.9.7 to add different?
    image
  2. kong support SRV (DNS record) if my SRV consul from the consul component does not have more dynamic records from API to kong?
    Please give me some help and I may need to evaluate these features. Thank you!
    Although there is no documentation, I would like to test whether these features meet the micro-service architecture needs!
@Tieske
Copy link
Member

Tieske commented Jan 13, 2017

  1. see feat(router) new API router with multiple hosts/paths and HTTP methods support #1970 it explains the new router, also in 0.10.0.
  2. I do not understand your question. Can you elaborate a bit?

@taojinxin
Copy link
Author

taojinxin commented Jan 13, 2017

Kong supports SRV if my SRV record comes from consul. Kong can consul the DNS interface to dynamically update the API?

what should I do

@Tieske
Copy link
Member

Tieske commented Jan 13, 2017

let's say you have registered two instances of the same service with consul. Then set up consul to expose those as an SRV record.

For example a service service.xyz, running on 10.10.10.1:123 (weight 10) and 10.10.10.2:456 (weight 5)

Now if consul provides a DNS record of SRV type for service.xyz, then you can configure Kong with an upstream_url=http://service.xyz/some/path.

Kong will now resolve service.xyz (using the SRV record it gets from consul) to the 2 ip+port as mentioned above, and will loadbalance the incoming requests over those 2 services (with total weight 15)

Make sure you configure Kong properly to use your consul installation for dns!

@Tieske
Copy link
Member

Tieske commented Jan 13, 2017

additionally: whenever consul gets updated, and ip/ports are added/removed from the service.xyz then Kong will automatically refresh and integrate those changes (after the ttl value of the SRV record expires, as Kong will then requery the dns server)

@taojinxin
Copy link
Author

OK, thank you, whether to automatically update the API to kong (dynamic update)?
kong Call consul the dns, recommend what way?
Modify the configuration file?

@Tieske
Copy link
Member

Tieske commented Jan 13, 2017

If you use consul, then letting Kong automatically update through the SRV dns records would be the right choice imo.

But if you only use consul for service registry, then you might cut out consul and do it directly with kong through upstreams and targets. See #157 (comment)

@taojinxin
Copy link
Author

thanks you !

The idea is that the kong and consul dns interfaces interact to dynamically update the API, and the registrator provides container information. Implement the dynamic update API

@Tieske
Copy link
Member

Tieske commented Jan 16, 2017

considering this resolved.

@Tieske Tieske closed this as completed Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants