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

Ability to pass explode/toJSON on all calls. #438

Closed
Telmo opened this issue Oct 19, 2015 · 1 comment
Closed

Ability to pass explode/toJSON on all calls. #438

Telmo opened this issue Oct 19, 2015 · 1 comment

Comments

@Telmo
Copy link

Telmo commented Oct 19, 2015

This is related to #434

Use case:

I have a number of microservices across multiple datacenters and I want nginx to route to the containers running those services, I can have 3 of service X running on DC Y and 8 of service X running on DC Z.

Currently iterating through service@dc will generate duplicate entries for services in the configuration. If toJSON were to work on all call as it does for map[string]interface {} service deduplication and more complex manipulations could be handled by a plugin.

@sethvargo
Copy link
Contributor

Hi @Telmo

Thank you for opening this issue. I've had some time to think about this, and I do not think Consul Template should permit manipulation of service(s) entries. This has not been a widely-requested feature, and I think the issues are you are encountering are a result of the way you have structured your data in Consul, and not necessarily a problem with Consul Template.

In general, each data center should be a self-contained representation. Cross-communication between data centers should be done at a higher level. For example, each microservice within in a data center should be fronted by a load balancer for that data center. This provides a single entry point for the microservice in the DC. If you would like to balance across multiple DCs, you would query for the single load balancer service in each data center instead of trying to munge all of the microservices into one template. This allows for a finer-grained control over on a per-DC basis.

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