Commit graph

259 commits

Author SHA1 Message Date
Vincent Demeester
421a3ec5d7 Use gofmt with -s instead of goimports
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-02-12 14:07:00 +01:00
Aidan Hobson Sayers
cfb3ce460b Don't allow passing EnableIPv6 as a driver option (a label)
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
2016-01-30 16:01:29 +00:00
Aidan Hobson Sayers
01d2ad412f Expose the enableIPv6 setting
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
2016-01-29 18:31:13 +00:00
aboch
3e6a42bcdb Merge pull request #880 from mavenugo/ddd
Force delete sandbox during sandboxCleanup
2016-01-19 13:57:53 -05:00
Madhu Venugopal
315004b575 Cache scope in network object
Its safe to cache the scope value in network object and can be reused
for cleanup operations. The current implementation assume the presence
of driver during cleanup operation. Since a remote driver may not be
present, we should not fail such cleanup operations. Hence make use of
the scope variable from network object.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-01-18 17:54:29 -08:00
Madhu Venugopal
a7c52918fd Force delete sandbox during sandboxCleanup
Stale sandbox and endpoints are cleaned up during controller init.
Since we reuse the exact same code-path, for sandbox and endpoint
delete, they try to load the plugin and it causes daemon startup
timeouts since the external plugin containers cant be loaded at that
time. Since the cleanup is actually performed for the libnetwork core
states, we can force delete sandbox and endpoint even if the driver is
not loaded.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-01-17 14:47:49 -08:00
Madhu Venugopal
69acfe6332 Merge pull request #863 from wenchma/typo_error
Fixes some typo errors
2016-01-16 12:23:52 -08:00
Madhu Venugopal
f9e4b40e5e Allow network-scoped alias to be resolved for annonymous endpoint
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-01-13 12:03:12 -08:00
wenchma
0b07ad6202 Fixes some typo errors
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2016-01-13 12:59:24 +08:00
Madhu Venugopal
ec622bf158 Forced endpoint delete
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-01-12 18:50:28 +00:00
Jana Radhakrishnan
06ff0a98a0 Merge pull request #859 from mavenugo/globalalias
Global alias support
2016-01-08 12:38:51 -08:00
Madhu Venugopal
2db863e5d7 Global alias support
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-01-08 12:27:15 -08:00
Ryan Belgrave
16ff947fb6 IpamOptions per network not per ipam subnet
Signed-off-by: Ryan Belgrave <rmb1993@gmail.com>
2016-01-07 21:28:54 -05:00
Santhosh Manohar
cf7ed0a717 Embedded DNS server
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-01-07 00:25:26 -08:00
Chun Chen
69fe328789 Add network options to NetworkInfo to display internal network option
Signed-off-by: Chun Chen <ramichen@tencent.com>
2016-01-06 10:03:15 +08:00
Chun Chen
186a32acab Add internal network option
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-12-22 09:29:39 +08:00
Madhu Venugopal
b464d40ce6 Merge pull request #822 from wenchma/18626-add_IpamInfo_func
Add IpamInfo() function to retrun ipamV4Info and ipamV6Info
2015-12-20 19:55:29 -08:00
Alessandro Boch
29299b73df Allow remote IPAM driver to express capability
- So that a DHCP based plugin can express it needs
  the endpoint MAC address when requested for an IP address.
- In such case libnetwork will allocate one if not already
  provided by user

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-12-17 15:41:47 -08:00
wenchma
294b858f2c Add IpamInfo() function to retrun ipamV4Info and ipamV6Info
Related to docker/docker#18626

Signed-off-by: wenchma <wenchma@cn.ibm.com>
2015-12-16 17:30:21 +08:00
Ryan Belgrave
44f532f16e When assigning an address for an endpoint set preferred address and
options.

When requesting a gateway address send a gateway label in the options.

Signed-off-by: Ryan Belgrave <rmb1993@gmail.com>
2015-12-04 00:00:03 -05:00
Alessandro Boch
dee3acc574 Release address pool before removing the network from store
- On network delete it is better to release the gateway address
  and address pool before removing the network from the datastore,
  given ipam data is dependent on network data.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-12-01 17:53:09 -08:00
Alessandro Boch
ea14d68757 libnetwork to honor explicit mac-address
- Currently endpoint interface mac address is
  not being set in network.go when user specified
  the mac address for the container.
- Overlay driver expects to get the user defined mac-address
  from InterfaceInfo.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-11-14 13:17:43 -08:00
Alessandro Boch
af7bc494f9 Allow IPv6 allocation post endpoint create
- Controlled by network option

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-11-10 14:53:19 -08:00
Jana Radhakrishnan
4850c5f1e6 Avoid duplicate entries in /etc/hosts
Currently the local containers of a global scope
network will get it's service records updated
from both a local update and global update. There
is no way to check if this is a local endpoint when
a remote update comes in via watch because we add
the endpoint to local endpoint list during join, while
the remote update happens during createendpoint.

The right thing to do is update the local endpoint list
and start watching during createndpoint and remove the watch
during delete endpoint. But this might result in the container
getting it's own record in it's /etc/hosts. So added a filtering
logic to filter out self records when updating the container's
/etc/hosts

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-23 16:39:40 -07:00
Alessandro Boch
e41a9cf59d Allow anonymous endpoint
- Allow to create an endpoint as anonymous.
  An anonymous endpoint does not get added
  to the network service records.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-20 14:05:46 -07:00
Madhu Venugopal
e8370e78d0 Changed Labels to DriverOpts
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-14 16:38:46 -07:00
Alessandro Boch
6b77f04e9b IPAM driver doc
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-12 16:39:24 -07:00
Jana Radhakrishnan
ab8dfb54fe Separate endpoint count data from network object
Currently endpoint count is maintained as part of
network object and the endpoint count gets updated
frequently while the rest of network is quite stable.
Because of the frequent updates to endpoint count the
network object is getting marshalled and unmarshalled
ferquently. This is causing a lot of churn and transient
memory usage. Fix this by creating a deparate object of
endpoint count so that only that gets updated.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-11 23:17:06 -07:00
Jana Radhakrishnan
922e45b5f2 Merge pull request #623 from aboch/ipc
Miscellaneous changes for ipam docker integration
2015-10-10 11:09:55 -07:00
Madhu Venugopal
750671e633 Default bridge need not have persistence in bridge driver
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-10 09:00:35 -07:00
Madhu Venugopal
50db985c1d Few more fixes identified during integration
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-10 03:49:39 -07:00
Madhu Venugopal
f8891e4f4a Merge pull request #625 from aboch/acf
Relax restriction on IpamConfig
2015-10-09 20:04:15 -07:00
Jana Radhakrishnan
dbbc561c18 Network ep count increment/decrement needs retry
Today we try to increment/decrement endpoint count
only once even if it is a key modified error. In case
of key modified error we should retry it to allow it to
succeed.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-09 19:37:25 -07:00
Alessandro Boch
24339bea43 Relax restriction on IpamConfig
- Both an empty and nil list of IpamConf object
  will trigger auto-allocation for ipv4.
  Auto-allocation for ipv6 will still be excluded
  in the two cases above.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-09 17:54:28 -07:00
Alessandro Boch
af95bfd273 Preserve default ipam driver setting
- If IPAMConf does not contain an ipam driver setting

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-09 14:24:49 -07:00
Alessandro Boch
0e04c8555e Network to expose ipam config
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-09 14:24:38 -07:00
Madhu Venugopal
bd45253fb5 move Labels from array to map to be consistent with cotnainers
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-09 11:08:13 -07:00
Alessandro Boch
02386e85d5 Enable Network labels in backend
- Allow labels to be passed to network driver during network create

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-09 01:06:15 -07:00
Jana Radhakrishnan
268d41835d Make bridge driver networks persistent
Since libnetwork is going to provide createNetwork
notifications only once when the network is created
bridge network needs to save it's network state in
persistent store so that it becomes available even
after restart.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-08 20:42:45 -07:00
Jana Radhakrishnan
82660a9d6f Merge pull request #600 from aboch/br
Bridge driver changes to support IPAM model
2015-10-08 16:30:43 -07:00
Alessandro Boch
af3eb25d44 Phase-2 bridge driver changes to support IPAM
- Set bridge ipv4 address when bridge is present
- IPv6 changes for bridge
- Convert unit tests to the new model

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-08 16:22:03 -07:00
aboch
dce266d406 Merge pull request #604 from mavenugo/vin-fixes
Fixed a few issues identified during docker integration
2015-10-08 15:35:54 -07:00
Madhu Venugopal
f2f536032b Phase-1 bridge driver changes to support IPAM
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-08 14:26:58 -07:00
Madhu Venugopal
2a392e5a98 Any newly added data to an existing marshalled object must nil check
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-07 14:51:46 -07:00
Alessandro Boch
b9596c89d6 libnetwork to handle allocation of ipv6
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-07 13:57:28 -07:00
Alessandro Boch
0cfaa590de Fix in handling aux addresses
- libnetwork should reserve only the auxiliary
  addresses which belong to the container
  addresable pool. And should fail the network
  creation if the aux addr does not belong to
  the master pool.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-07 13:06:41 -07:00
Jana Radhakrishnan
71e14dd52a Remove always-on watch for networks and endpoints
Always on watching of networks and endpoints can
affect scalability of the cluster beyond a few nodes.
Remove pro active watching and watch only the objects
you are interested in.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 14:15:49 -07:00
Madhu Venugopal
cc1e49cbbb Fixed a bug in AuxAddresses handling in libnetwork core
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-04 18:59:07 -07:00
Alessandro Boch
ddcfab5f81 libnetwork <-> ipam driver interaction
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 16:18:19 -07:00
Alessandro Boch
2aaef377f3 IPAM driver
- Add IPAM cotract and remote IPAM hooks
 - Add ipam registration in controller
 - Have default IPAM follow ipamapi contract

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 16:18:19 -07:00