-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Adding support for internal ip/port usage. #18
Conversation
This patch adds support for using -internal to register docker0 internal ip and port settings, instead of using the docker host mapped ones.
@@ -131,24 +141,30 @@ func (b *RegistryBridge) Add(containerId string) { | |||
|
|||
ports := make([]PublishedPort, 0) | |||
for port, published := range container.NetworkSettings.Ports { | |||
var hp string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be collapsed into one line. var hp, hip string
@cnf Any update on this? |
I would love to register container internal addresses, because I use routable (inside the cluster) --bip networks. |
For consul, we are waiting for a new release that would change the way this works. @progrium would you accept this PR if I took out the consul part for now, and applied only the etcd part? |
Yes. :) |
I found the implementation of the -internal flag hard to read. I think it might be easier to do if creation of a registrator Service from a Docker PortBinding is turned into a strategy. Then we can have two separate code paths that are both easy to read for both use cases. However, this would be simpler if we could rename PublishedPort to PortBinding, so that the code can clearly distinguish between exposed and published ports (since those are really the two registration strategies we're talking about here). Would you be comfortable with that intrusive a change? |
Pulled out the consul changed for now. I'll make a new PR when the new consul changes come out. |
FYI, the merge conflict is just from stage/registrator. |
I hope we're not in one of those situations where everyone is waiting for everyone else. ;-) I'm waiting for this PR to go in. Is that on the cards? |
Anything you need to accept this, @progrium ? |
I'm going to check it out this week. On Sun, Oct 5, 2014 at 7:30 AM, Frank Rosquin notifications@github.com
Jeff Lindsay |
|
@cnf could you expand on your comment about waiting on a change in Consul, please ? Do you have a pointer on what will that change be ? |
Also needs a rebase. Sorry. |
Adding support for internal ip/port usage.
Hooray! Now for releases and tests. Busy skilling up on golang's testing library. Do you have a library preference for testing and/or assertions? |
Usually the builtin one. Backends will need mocks. :\ |
@cnf was there a reason you added the check for internal at https://github.com/progrium/registrator/blob/master/bridge.go#L173? This causes all exposed ports (instead of just published ones) to be registered, which isn't consistent behavior. I'm proposing to remove that check in a new pull request if you aren't explicitly depending on it for some reason. |
@andyshinn this was the entire point of the pull request. Register internal ports. you need to supply the --internal flag for this to be applied. |
I meant more specifically about registered all the exposed internal ports instead of just the ones specified with If I use the |
-p publishes, which isn't what internal is about. |
This patch adds support for using -internal to register docker0
internal ip and port settings, instead of using the docker host
mapped ones.