Skip to content

Conversation

@bru7us
Copy link

@bru7us bru7us commented Aug 13, 2015

This is the libnetwork portion of work required to define port persistence policies (see moby/moby#12622)

Requesting a port without a range will act in the same way as before (docker master does this).
Specifying a range with port "0" will allocate the next available port from that range.
Specifying a range and a non-zero port will first try to allocate the requested port, then fallback to next available in the range if the requested port is already allocated.

Signed-off-by: Dave Russell bru7us@bru7us.com

@bru7us bru7us force-pushed the port-allocation-persistence branch 3 times, most recently from 3ff441e to 8c03d6d Compare August 13, 2015 05:41
@bru7us
Copy link
Author

bru7us commented Aug 13, 2015

@mavenugo, this a minor extension to #285 that just merged today. It enables "preferred" port allocation requests from a range that will support port persistence policies.

All we do here is:

  • Add HostPortStart to the PortBinding (so we now have explicit requested port, range start and range end)
  • Propagate the added element through all dependent function calls
  • Deliver "preferred" port allocation requests from a specified range

This should still be back-compatible with current docker master, but conflicts slightly with PR moby/moby#12927 (@dkjer), which would need to also add the separation of HostPort and HostPortStart if you accept this PR.

This is the libnetwork portion of work required to define port persistence policies (see moby/moby#12622)
Remains backward-compatible with docker/docker master

Signed-off-by: Dave Russell <bru7us@bru7us.com>
@bru7us
Copy link
Author

bru7us commented Aug 21, 2015

Now that moby/moby#12927 got merged - refactored this one to stay backwards compatible with docker master.

@bru7us
Copy link
Author

bru7us commented Aug 27, 2015

Hey @mavenugo, was hoping to get some feedback on this part before I rewrite the docker/docker side. I think I'd use slightly different wording for the policies, something like "--port-persistence = [ default | preferred | enforced ]", but apart from that, the concept hasn't really changed much in my mind from where we ended up in moby/moby#12622

@bru7us
Copy link
Author

bru7us commented Sep 28, 2015

@mavenugo @aboch @mrjana, Any input on this one?

My office had a big outage this morning and had to spend a lot of time reconfiguring our load balancer/proxy after all of our docker hosts restarted. These port persistence policies would have allowed us to auto-recover with no manual input other than restarting the hosts and containers.

Would love to continue pressing forward with this.

@GordonTheTurtle
Copy link

@bru7us It has been detected that this issue has not received any activity in over 6 months. Can you please let us know if it is still relevant:

  • For a bug: do you still experience the issue with the latest version?
  • For a feature request: was your request appropriately answered in a later version?

Thank you!
This issue will be automatically closed in 1 week unless it is commented on.
For more information please refer to #1926

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants