Skip to content

Allow user to specify default address pools for docker networks#36054

Closed
selansen wants to merge 0 commit intomoby:masterfrom
selansen:master
Closed

Allow user to specify default address pools for docker networks#36054
selansen wants to merge 0 commit intomoby:masterfrom
selansen:master

Conversation

@selansen
Copy link
Copy Markdown
Contributor

This is the work done by aboch (PR #29376) a while ago. I have made changes on top of it and tested it. I will be creating two more PRs, one for Libnetwork and one for CLI documentation. Will update PR details here soon.

  • Description
    When user creates a network without specifying a --subnet, docker will pick a subnet for the network from the static set 172.[17-31].0.0/16 and 192.168.[0-240].0/20 for the local scope networks and from the static set 10.[0-255].[0-255].0/24 for the global scope networks.

For different reasons, several users have asked to be able to control these defaults.
This PR brings in a change to allow users to control the default address pools at daemon boot.

As an example,
dockerd --default-address-pools base=10.10.0.0/16,size=24
would allow user to set the 256 pools 10.10.[0-255].0/24 as default for the local scope networks.

Multiple --default-address-pools can be specified.
To specify the option in the config json file:

{"default-address-pools":[{"base":"172.80.0.0/16","size":24},{"base":"172.90.0.0/16","size":24}]}

@selansen
Copy link
Copy Markdown
Contributor Author

Note : This PR was already reviewed by many a while ago and additional changes on top of old PR need to be reviewed.

@doberloh
Copy link
Copy Markdown

So happy to see this coming in!! (hopefully). Keep up the great work!

+a billion

@selansen
Copy link
Copy Markdown
Contributor Author

selansen commented Jan 18, 2018 via email

@Vanuan
Copy link
Copy Markdown

Vanuan commented Jan 27, 2018

Failure message:

05:09:54 The result of vndr differs
05:09:54 
05:09:54  M vendor/github.com/docker/libnetwork/ipamutils/utils.go
05:09:54 
05:09:54 Please vendor your package with github.com/LK4D4/vndr.

@selansen
Copy link
Copy Markdown
Contributor Author

selansen commented Jan 27, 2018 via email

@selansen selansen force-pushed the master branch 2 times, most recently from cbc75df to e687e58 Compare January 29, 2018 19:49
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can still be part of the API suite, and use the API to do the inspect instead of the docker cli.

@selansen selansen force-pushed the master branch 6 times, most recently from 9b800b3 to 0de683e Compare February 1, 2018 18:49
Comment thread daemon/config/config_unix.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should avoid this method and pass the Pool (if any) as a network option and not change the ipam init code path

@kolyshkin
Copy link
Copy Markdown
Contributor

AFAIK new test cases needs to be written using the machinery from integration (rather than integration-cli). This mostly means using API calls rather than invoking docker cli.

@selansen
Copy link
Copy Markdown
Contributor Author

selansen commented Feb 2, 2018 via email

@thaJeztah
Copy link
Copy Markdown
Member

@selansen looks like this needs a rebase

@thaJeztah
Copy link
Copy Markdown
Member

Continued in #36396

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.

9 participants