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

Expand ${DC} to consul datacenter #55

Closed
sielaq opened this issue Feb 16, 2016 · 3 comments
Closed

Expand ${DC} to consul datacenter #55

sielaq opened this issue Feb 16, 2016 · 3 comments
Milestone

Comments

@sielaq
Copy link
Contributor

sielaq commented Feb 16, 2016

Hi,

we need possibility to use variables like service_name.service.$DC.$DOMAIN in tag,
so it will solve issue when having same plans for multiple datacenters and using consul domains.

This can be solved also in other way around. Adding new fabio.property use.consul.domain or tag
(to use consul domains automatically).
for example:

  • input:
    service: consul
    datacenters: ams, fra
    possible consul domains: consul.service.consul, consul.service.ams.consul, consul.service.fra.consul
    tag: use_consul_domain
  • result:
    fabio generate 3 routes:
    consul.service.consul, consul.service.ams.consul, consul.service.fra.consul that routes to same consul service
@sielaq sielaq changed the title We need possibility to use basic consul-variables in tag [FR] We need possibility to use basic consul-variables in tag Feb 16, 2016
@magiconair magiconair changed the title [FR] We need possibility to use basic consul-variables in tag Support basic consul-variables in tag Feb 22, 2016
@magiconair
Copy link
Contributor

The use-case as I understand it after some discussion is this:

When services are accessed via fabio through their generic consul DNS name then each service has two names:

mysvc.service.consul
mysvc.service.${DC}.consul

Services could discover the data center during startup and register the appropriate prefixes. However, this is not possible when registering Docker containers through registrator. By allowing to expand ${DC} to the data center of the consul agent a service can register two generic prefixes which work in any data center.

urlprefix-mysvc.service.consul/
urlprefix-mysvc.service.${DC}.consul/

@magiconair
Copy link
Contributor

Generating multiple routes for any number of data centers is not necessary.

magiconair added a commit that referenced this issue May 3, 2016
Expand the ${DC} variable in a urlprefix to the
data center of the consul agent.
@magiconair magiconair changed the title Support basic consul-variables in tag Expand ${DC} to consul datacenter May 3, 2016
magiconair added a commit that referenced this issue May 5, 2016
Expand the ${DC} variable in a urlprefix to the
data center of the consul agent.
magiconair added a commit that referenced this issue May 5, 2016
Expand the ${DC} variable in a urlprefix to the
data center of the consul agent.
@magiconair
Copy link
Contributor

It is merged.

@magiconair magiconair added this to the 1.1.3 milestone May 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants