-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Setting unique backend name + backend redirecting to internal container ip #294
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
Setting unique backend name + backend redirecting to internal container ip #294
Conversation
|
Thanks @samber ! |
…d redirecting to internal container ip
ce1fe2c to
4f044cf
Compare
|
Done ;-) |
|
LGTM 🐰 |
|
Trying this out after fixing the service address I'm registering but I'm getting issues from some of the static configured services we have in consul. Configured by json files in the consul directory where we don't set the ip because it's optional and would be discovered at runtime. The health route returns the service address as empty string but querying these through the consul dns returns the node ip. I think the node address should be used as a fallback to match what consul itself does. Oh, and now it even fails to do anything because a name collision in backend names when the service address is empty. |
|
There is no unique id in Consul, maybe shall we set a random id or put an index at the end of the service name ? (ex: web-80-1, api-443-2, nginx-80-3...) IMO, Traefik shouldn't retrieve these services without valid ip. In your json file, can you declare the service as unhealthy ? |
|
I'm not sure it's really invalid though because according to documentation the field is optional https://www.consul.io/docs/agent/services.html
|
|
Indeed: there is an issue with backend names: #309 |
|
Mmmh, ok let's do that. I don't know your needs, but i think the best practice in that case would be to register your service in consul with a Status to warning or critical: https://www.consul.io/docs/agent/http/catalog.html#catalog_register |
|
Sorry. Let me try to explain my scenario a bit better. It's not the case of unhealthy service at all. We have some services that are deployed as plain old rpm and runs directly on the host without any container or network isolation. We register these into consul with static json configurations we don't specify the service address because we are perfectly fine using the same as the agent running on the same host. e.g /etc/consul/services.json |
|
Ok, thanks @keis |
see #275
Caution: Breaking (see issue)