-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Adding network specific option in csv format for service create/update #62
Conversation
7f84759
to
d07478e
Compare
ping @thaJeztah |
@abhinandanpb can you pls add a link to the moby PR that carries the API and backend changes ? |
@abhinandanpb am not a compose/stack expert. But I think we should support the new network csv format and |
I believe we already support these fields in Compose. Was there a new field added, or is this just a way to have service create auto-create a network? CSV structures on the CLI are just a hack because we don't have any other way of representing nested/structured data. In a YAML file we have an actual structure, so we don't need this hack. |
@dnephin new option is not added rather the existing --network,--network-add option is updated to accept csv. I believe it will need some change on compose side to tie it to the backend structs. |
The change corresponds to the PRs in moby/moby#33130 and moby/swarmkit#2176 |
We already supported creating networks as part of |
@dnephin I probably should have clarified one thing. Previously service create/update was supporting only network name as a part of --network option. Since with this PR we will start supporting csv - we will support --network name=docknet,alias=web-prod,driver-opt=encap=vlan . |
I don't think we want to add any fields to the compose format for this. We already supported creating networks with all the options on The only change we might want to make is to have the networks created as part of the service create API call, instead of as separate network create API calls. I'm not sure if there are any significant advantages (or disadvantages) to this. |
@dnephin No I think what this is doing is stashing network options IN services. As in, API level. I'm not sure I understand why though? |
Yes, that was my understanding. Isn't it doing this as a way to auto-create a network with these options when the service is created? That was my assumption. |
@dnephin I don't think so (I'm trying to understand the swarmkit PR which led me back here). I think those are network options specific to how a particular service will connect to a given network. |
@dnephin @aluzzardi these are network specific options to be sent to the drivers per container/task/service. This is used by the plugins for various reasons. This is one of the most popular request from many of the network plugin users. |
@dnephin @aluzzardi fyi : moby/moby#27638 ... this is the original PR that kick started all this. |
@dnephin @aluzzardi and this is more of a blanket issue moby/moby#31964 which is also addressed. |
I've verified that the CSV network options make it into the resultant container's NetworkSettings.Networks, as follows -
|
Thanks @eyz ! |
The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's. The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker#62 . This commit extends this support to docker run command as well. For docker connect command --driver-opt is added to pass driver specific options for the network the container is connecting to. Signed-off-by: Abhinandan Prativadi <[email protected]>
The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's. The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker#62 . This commit extends this support to docker run command as well. For docker connect command --driver-opt is added to pass driver specific options for the network the container is connecting to. Signed-off-by: Abhinandan Prativadi <[email protected]>
The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's. The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker#62 . This commit extends this support to docker run command as well. For docker connect command --driver-opt is added to pass driver specific options for the network the container is connecting to. Signed-off-by: Abhinandan Prativadi <[email protected]>
ping @abhinandanpb @mstanleyjones looks like this was not yet documented |
@abhinandanpb can you please update the service_create.md and service_update.md in this repository to add this info to the correct sections? |
@mstanleyjones @thaJeztah thanks. I will get this done today |
@abhinandanpb were these doc changes ever pushed to this repo? |
The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's. The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker#62 . This commit extends this support to docker run command as well. For docker connect command --driver-opt is added to pass driver specific options for the network the container is connecting to. Signed-off-by: Abhinandan Prativadi <[email protected]>
The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's. The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker#62 . This commit extends this support to docker run command as well. For docker connect command `--driver-opt` is added to pass driver specific options for the network the container is connecting to. Signed-off-by: Abhinandan Prativadi <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's. The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker#62 . This commit extends this support to docker run command as well. For docker connect command `--driver-opt` is added to pass driver specific options for the network the container is connecting to. Signed-off-by: Abhinandan Prativadi <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's. The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker#62 . This commit extends this support to docker run command as well. For docker connect command `--driver-opt` is added to pass driver specific options for the network the container is connecting to. Signed-off-by: Abhinandan Prativadi <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's. The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker#62 . This commit extends this support to docker run command as well. For docker connect command `--driver-opt` is added to pass driver specific options for the network the container is connecting to. Signed-off-by: Abhinandan Prativadi <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
The commit contains cli changes to support driver options for a network in docker run and docker network connect cli's. The driver-opt, aliases is now supported in the form of csv as per network option in service commands in swarm mode since docker/cli#62 . This commit extends this support to docker run command as well. For docker connect command `--driver-opt` is added to pass driver specific options for the network the container is connecting to. Signed-off-by: Abhinandan Prativadi <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: c4844b1fddf6d86e1eece5cf2e92cd975aa5a422 Component: cli
- What I did
Changed the network option to accept csv format values in service/create update
- How I did it
Created a new networkOpt type which accepts csv format values
- How to verify it
The cli change will allow users to pass driver options, alias and network name as a part of service create and service update. The driver options information will eventually trickle down as a part of endpoint create and join which will allow the drivers to use this information for any additional processing for the endpoint.
Alias information is already part of docker run as
--net-alias
. However since service can be created and updated with multiple networks there is a need to pass network specific aliases which can also be done with this change.Relevant PRs:
moby/swarmkit#2176 and moby/swarmkit#2183 (merged)
moby/moby#33130