-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Feature] Service Discovery using Consul #1630
Comments
In the short-term, check out Traefik. That's what it specializes in. Maybe a plugin would be more appropriate for this feature? |
Yes i think a plugin could be a good solution. But is plugin can create in-memory caddyfile configuration ? Dont Know if a hook Exist... |
I think the rewrite of the proxy will make this possible. (See linked issue.) |
Semi-related: https://github.com/brimstone/caddy-consul |
@josegonzalez That's cool, what does it do exactly? (ELI5-and-have-never-used-consul) |
Seems like a caddy plugin (not that I've used any) that will:
|
Hi everyone, I forked https://github.com/brimstone/caddy-consul for my own use. https://github.com/krishamoud/caddy-consul is available for anyone who wants to give it a shot. I tried to make it as generic as possible so you can add your own template and the caddyfile will look how you want it to. |
Cool. I think this is now possible by reverse proxying to |
Note: For those more familiar with consul, a slightly faster way would be to watch for consul service changes on the local client via stale reads (non-stale reads will go direct to the consul cluster leader). Consul can then invalidate records for services you are watching for before you actually invalidate DNS. |
@josegonzalez How trivial is that change to implement, do you think? Is it something that could be a good PR? |
I am a little confused on the status of this. The issues is closed but I cannot seem to find any docs on a consul integration. Is the following traefik config possible with caddy or not?
|
There's no direct consul integration, but you can point Caddy's proxy to its |
@mholt forgot to respond but the big thing with my method is you would need a method to store global state (so that you can store the lookup of services on your end). Not sure how I'd go about that with caddy, but definitely could be a good optimization (maybe a scheme of |
@josegonzalez we're working on a rewrite of upstream management which will bring major improvements to SRV upstreams. I think this will help significantly with Consul users as well: #4470 Please take a look at that PR and give it a try it you can, we're collecting feedback! |
Hello,
It could be very nice if Caddy can be dynamically reconfigured by Consul (consul.io).
In a micro-services environment (or not) it allow caddy to get list of available proxy address and path without manual reload.
Nginx have this kind of feature, but only on the "Plus" version. I think it was a killer feature for Caddy.
https://www.nginx.com/blog/service-discovery-with-nginx-plus-and-consul/
https://www.nginx.com/blog/service-discovery-nginx-plus-srv-records-consul-dns/
Thanks
The text was updated successfully, but these errors were encountered: