-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support Consul service endpoints for service discovery #100
Comments
Yep, I would very much like this and would like to start working on it. It makes more sense than just the kv store because those don't take advantage of Consul's health checks and such. My first thought was to have a flag to enable service endpoints and then namespacing those keys under a
|
I got something put together last week that works pretty nice (based off the I didn't add a flag to control the generation, as I thought it was just something that should be supported out of the box. I went to the route of just injecting the service data into the KV using paths:
And additionally,
Then in the template, I could use the normal KV methods:
I like the structure of your example above though, but I find it might be hard to support tags and datacenters using the style. Perhaps something that's a hybrid where, we use a method to get the service information?
Then, that could be expanded to include tags:
|
Actually, I like your implementation better. No need to abstract the Consul api 😄 I'm not that familiar with gotext templating so I was just going off of the confd docs. Yea, if you post that PR I'll defintely help! |
Here's my first crack at this: #102 |
Consul documentation says: Lookup consul nodes using SRV records will be available in 0.5.0 Is there any timeline around 0.5.0? I can work on it but i see PR already submitted for this. Please let us know. |
The SRV record support is for using SRV records from consul to detect the backend nodes for confd itself, not for acquiring the consul service information and exposing it to templates. I was confused by that initially as well. Yeah, I put #102 out there as my attempt to solve this problem. |
See #102 but the idea is that we will add support this via custom backends. |
) Bumps [github.com/go-zookeeper/zk](https://github.com/go-zookeeper/zk) from 1.0.2 to 1.0.3. - [Release notes](https://github.com/go-zookeeper/zk/releases) - [Commits](go-zookeeper/zk@v1.0.2...v1.0.3) --- updated-dependencies: - dependency-name: github.com/go-zookeeper/zk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Currently, confd is limited to accessing the KV store of consul. It would be very helpful if the service and nodes endpoints could also be accessed. Then things like writing a HAProxy conf file can be done by querying the healthy endpoints for a service in Consul (not sure what/if there is a similar feature in etcd).
Would there be interest in a feature like this? I may be able to get schedule some work at my job to develop it if there is interest.
The main question without looking at anything yet is how would the confd templating discriminate between normal KV and the service or node data.
The text was updated successfully, but these errors were encountered: