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

translate_wan_addrs not working for DNS? #2390

Closed
JoeOrtiz opened this issue Oct 5, 2016 · 5 comments
Closed

translate_wan_addrs not working for DNS? #2390

JoeOrtiz opened this issue Oct 5, 2016 · 5 comments
Labels
type/docs Documentation needs to be created/updated/clarified
Milestone

Comments

@JoeOrtiz
Copy link

JoeOrtiz commented Oct 5, 2016

I thought this worked before, but since I upgraded to the new version 0.7.0 it always gives me the public IP address in different datacenters.

Although via consul template, I can get the public IP, but not in DNS anymore, and in the catalog it does show properly:

[
  {
    "Node": "i-20414138",
    "Address": "52.38.X.X",
    "TaggedAddresses": {
      "lan": "10.20.0.124",
      "wan": "52.38.X.X"
    },
    "ServiceID": "i-20414138.node.us-west-2-exe-tools:jenkins:8080",
    "ServiceName": "jenkins",
    "ServiceTags": [
      "tools",
      "us-west-2",
      "us-west-2a",
      "m1.xlarge",
      "exe-tools"
    ],
    "ServiceAddress": "10.20.0.124",
    "ServicePort": 8080,
    "ServiceEnableTagOverride": false,
    "CreateIndex": 262851,
    "ModifyIndex": 262851
  }

It does work if I ping i-20414138.node.us-west-2-exe-tools.consul but not jenkins.service.us-west-2-exe-tools.consul it always gets the private IP.

@JoeOrtiz
Copy link
Author

JoeOrtiz commented Oct 6, 2016

I've just checked on the consul-template if they still showed the wan IPs, while I did test this initially with consul 0.7.0 in a whole new datacenter on this version. I see that now while that hasn't been touched at all, it isn't showing the wan IPs, just the private IPs, and this was working before.

@slackpad
Copy link
Contributor

slackpad commented Oct 6, 2016

Hi @JoeOrtiz it looks like that service has "ServiceAddress": "10.20.0.124" defined. If that's set then it won't do address translation, it will always report that. If you register the service and leave that blank I think it should work.

https://github.com/hashicorp/consul/blob/master/command/agent/dns.go#L765-L770

@slackpad slackpad added the type/docs Documentation needs to be created/updated/clarified label Oct 6, 2016
@slackpad
Copy link
Contributor

slackpad commented Oct 6, 2016

We should make a note about this in the documentation.

@JoeOrtiz
Copy link
Author

JoeOrtiz commented Oct 9, 2016

Hi @slackpad , this was indeed the problem. I can confirm it now works.

This was due to registrator, we had passing --ip, once this was removed, this works as intended.

Although this causes a problem now with the consul HTTP healthchecks, since consul does a GET on it, since there is no IP for $SERVICE_IP, those health checks will fail. Is there anyway to tell consul to use its own local lan IP, as the lan and wan IP show up properly, but not its service IP, so it can't run it's health check.

I am a little afraid to enable in registrator the --internal option, but not too sure if this will mean it will register that now as the SERVICE_IP, and then I would lose my wan/lan capabilities.

@jsosulska
Copy link
Contributor

This looks to have been addressed several years ago. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

No branches or pull requests

3 participants