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

Carry IP addresses for each port #2

Merged
merged 1 commit into from
Apr 6, 2017
Merged

Conversation

relistan
Copy link
Collaborator

@relistan relistan commented Mar 31, 2017

This is a really important change.

  1. This will prevent issues where hosts have short names and where the search domains don't match on the Sidecar hosts.
  2. It allows for hosts to have multiple interfaces and export the containers on the specified port.
  3. It paves the way for Sidecar to serve DNS SRV records. It will be able to provide sidecar-specific hostnames that point to proper IP addresses.

Static discovery will use any provided ports or will use the default published IP when this is not specified. HAproxy will default to using the hostname as beforewhen the ports do not have IPs specified. When a Docker container reports a port with an IP address of 0.0.0.0, DockerDiscovery will instead replace it with the default published IP address.

@felixgborrego @mihaitodor @bparli @intjonathan

This is a really important change. It allows for hosts
to have multiple interfaces and export the containers
on the specified port. Static discovery will use any
provided ports or will use the default published IP
when this is not specified.

HAproxy will default to using the hostname as before
when the ports do not have IPs specified.

When a Docker container reports a port with an IP
address of 0.0.0.0, docker discovery will instead
replace it with the default published IP address.
Copy link

@mihaitodor mihaitodor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just left a minor question.

@@ -24,6 +24,7 @@ type Port struct {
Type string
Port int64
ServicePort int64
IP string
Copy link

@mihaitodor mihaitodor Mar 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small design question: why not use the net.IP type to store IPs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because they are only used to write out text so doing that would just require parsing and generating strings over and over

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, cool! 🐑

@bparli
Copy link

bparli commented Mar 31, 2017

LGTM too

I'm forcing a DNS resolution in the traefik sidecar provider. With this change we should be able to relax that now

@relistan relistan merged commit 2f5d357 into master Apr 6, 2017
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

Successfully merging this pull request may close these issues.

3 participants