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
Docker Network UX & remote API changes #16645
Conversation
01a2b13
to
40d6eba
Compare
Some notes from playing with this:
|
@cpuguy83 thanks for the feedback. Will look into these. |
3d4bba1
to
fa2631f
Compare
#1 is a backend issue in libnetwork (moby/libnetwork#572). As discussed in IRC, we are trying to be consistent with the current network resource usage when the container is down and hence, its not appropriate to hold onto network resources when it is not active. But having said that, there has been requests for ip-address stability across container restarts (moby/libnetwork#569). When we resolve that, we could potentially remove this restriction and allow users to connect and disconnect from networks even when the container is down. |
The windows CI failure is not related to this PR and I see multiple PRs failing on the same issue. |
Hey @mavenugo, awesome work on this -- this is exciting stuff. The simplified UX is nice! 👍 This works great, the steps I followed to get this working are in this gist: https://gist.github.com/tombee/fa22d54923829b8be046 |
@tombee thanks for the feedback and trying it out using the multi-host networking feature. |
Sorry, just deleted some comment, I realized I was testing the wrong branch... too many PRs :) |
At this point I don't see the value in |
|
I stand corrected. I see that Also, why don't stopped container show up in |
I think its critical to return the scope of the network in |
In the container inspect why would we prefer to put the network name in I also prefer id's because I often log docker inspect output. Over time you can create and delete things with the same name. It's nice to have a unique reference like the ID. |
@ibuildthecloud thanks for trying out the changes.
Will fix it
Agreed. will fix it
Thats because, with the current backend implementation, When a container is stopped, we cleanup the endpoints and free up sandbox, endpoint and cleanup all the network resources allocated for that. These are operational state. If the container is started again, we will make use of the NetworkSettings (Configuration state) to recreate the resources appropriately.
okay. That requires a back-end API change. am trying to keep this PR purely UX centric (as you can see there is no libnetwork vendor-in in this PR) to ease the reviewer burden. We can update it in another PR after the backend is updated.
The main purpose is that, we dont persist the default networks (bridge, none and host). Hence upon restart these default networks get a new ID, but the name remains the same. That is the only reason. |
Design 👍 I like this a lot. Only thing that was a little weird is the ordering of |
thanks @cpuguy83
Yes, we did think of that. but, decided to settle with due to a matter of convention where folks would come to expect the param to be the key for all the |
@mavenugo I think IP stability is important. Specifically I'm dealing with hadoop right now and if you change the IP bad things happen. We are currently using our managed networking which maintains IPs across reboot, but I think that should be a core feature. For the NetworkSettings.Networks, is it possible there is a compromise such that IDs go in there except host, bridge, none put the name. I really need to know if the networks are global vs local, can that be added to the API? Last thing. I noticed that |
@ibuildthecloud IP stability is completely separate from this change, especially since there is no stability today. |
introduced --subnet, --ip-range and --gateway options in docker network command. Also, user can allocate driver specific ip-address if any using the --aux-address option. Supports multiple subnets per network and also sharing ip range across networks if the network-driver and ipam-driver supports it. Example, Bridge driver doesnt support sharing same ip range across networks. Signed-off-by: Madhu Venugopal <madhu@docker.com>
i cant reproduce the example in the UX-doc with
|
@guybrush network docs will be updated soon; updating |
woah that was fast response, i cant wait to use the new feature :D thanks! |
@mavenugo:- Can I pass multiple networks in --net option ? or is there any plan for supporting it. Thanks in advance for letting me know. |
@manoj0077 it's not supported at this moment (it would be a nice addition though), but you can dynamically add a container to a network;
For documentation related to the new networking, see https://github.com/docker/docker/blob/master/docs/userguide/networking/index.md |
Updating devref to address following changes: 1. Removal of 'service' from docker 2. Vendoring in IPAM driver support from libnetwork to docker. This allows user to pass subnet of their choice using docker cli. In case if user does not provide subnet related configuration and neither remote ipam driver while creating network, built-in ipam driver will provide default subnet configuration. refer to the links for details: moby/moby#16645 https://github.com/docker/libnetwork/blob/master/docs/ipam.md Change-Id: I30f5cb54d4feadafc954f6e4b09bcbd6243e6c00 Closes-Bug: #1505489
@thaJeztah So is there a possibility to add multiple interfaces at the time of starting of container itself.... |
@manoj0077 no. it is not possible currently. |
Is this still an experimental feature in 1.10? |
@zrml no, it's no longer experimental https://docs.docker.com/engine/userguide/networking/dockernetworks/ |
This was never used in a non-experimental branch. It was removed from docker in moby/moby#16645. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This PR is a follow up for various discussion around docker network experimental UX and API.
Includes :
--publish-service
with--net=<user-defined-network>
--default-network
daemon flagNote that this PR updates the UX and API aspects of the CNM functionality.
there are a few related back-end issues still open (moby/libnetwork#567, moby/libnetwork#570, moby/libnetwork#568) and will be addressed as part of libnetwork vendor-in in subsequent PRs.
UX (https://github.com/mavenugo/docker/blob/ux/docs/userguide/dockernetworks.md)
API (https://github.com/mavenugo/docker/blob/ux/docs/reference/api/docker_remote_api_v1.21.md#25-networks).