Commit Graph

113 Commits

Author SHA1 Message Date
Flavio Crisciani ea2dcf7eb5
Add service virtual IP to sandbox's loopback address
Refreshed the PR: https://github.com/docker/libnetwork/pull/1585
Addressed comments suggesting to remove the IPAlias logic not anymore used

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-08 16:16:45 -07:00
Derek McGowan 43f00b74d7 Update logrus to v1.0.1
Fix case sensitivity issue
Update docker and runc vendors

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-08-07 11:20:47 -07:00
Flavio Crisciani c6917f91f5
Add gosimple check
Add the gosimple tool check in the Makefile
Fix all the issues identified

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-06 09:42:38 -07:00
Madhu Venugopal e7b3f40bf7 Merge pull request #1778 from WeiZhang555/fix-leaking-netns-file
[bug]Fix race between sandbox.delete() and SetKey()
2017-06-13 20:06:09 -07:00
Flavio Crisciani d64e71e4f7
Service discovery logic rework
changed the ipMap to SetMatrix to allow transient states
Compacted the addSvc and deleteSvc into a one single method
Updated the datastructure for backends to allow storing all the information needed
to cleanup properly during the cleanupServiceBindings
Removed the enable/disable Service logic that was racing with sbLeave/sbJoin logic
Add some debug logs to track further race conditions

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-11 20:49:29 -07:00
Zhang Wei 4688e41ba6 [Bug]Fix race between sandbox.delete() and SetKey()
When sandbox is deleting, another SetKey routine could be also in
progress as there's no lock to protect it, when this happens, there
could be a scene that one sandbox is removed, but it's osSbox file
"/var/run/docker/netns/xxxx" left on system and will never be cleaned.

So add a inDelete check for SetKey() to eliminate the race.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-05-25 15:35:24 +08:00
Alessandro Boch 492253285f Sandbox.SetKey() should not reset the osl sandbox on failure
Because the failure would not be on creating the osl sandbox
(which is done by somebody else). It would be on the programming
libnetwork does on the osl sandbox. In case of failure just report
the error. External caller will take care of removing the parent sandbox
via the cleanup on the error handling path. Otherwise the osl sandbox
will never be removed.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-03-28 13:17:10 -07:00
Santhosh Manohar 5ac04367ae Merge pull request #1609 from aboch/gw46
Prioritize nw endpoint which can provide both v4 and v6 connectivity
2017-01-05 13:00:01 -08:00
Alessandro Boch 1ed42d1d80 Merge pull request #1595 from sanimej/host
Add support in embedded DNS server for host loopback resolver
2017-01-05 12:18:48 -08:00
Alessandro Boch f774a9e575 Prioritize nw endpoint which can provide both v4 and v6 connectivity
- when selecting sandbox's default gw

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-01-04 09:40:28 -08:00
allencloud c1865b811b fix nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-12-28 18:49:18 +08:00
Santhosh Manohar 14ae4337e1 Add embedded DNS server support for host loopback resolver
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-12-22 14:34:13 -08:00
Santhosh Manohar 805efb1843 Defer PTR queries to external servers based on A/AAAA response
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-12-20 14:45:13 -08:00
Madhu Venugopal 097cea5ded Revert "Enable ping for service vip address"
This reverts commit 185fd8d362.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-11-21 03:30:27 -08:00
Santhosh Manohar 19e42ae0e7 Separate service LB & SD from network plumbing
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-11-17 13:09:14 -08:00
Santhosh Manohar 95c683b1bb Add a nil check for sandbox.osSbox
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-11-15 10:09:19 -08:00
Daehyeok Mun b735bb2ada Refactoring logrus import and formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.
Also fix import name to use original project name 'logrus' instead of
'log'

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-11-08 12:42:41 -07:00
Alessandro Boch a98901aebe Merge pull request #1519 from sanimej/newlb
Add sandbox API for task insertion to service LB and service discovery
2016-11-03 13:31:46 -07:00
Jana Radhakrishnan 123a301826 Merge pull request #1501 from sanimej/vip
Enable ping for service vip address
2016-11-02 09:45:14 -07:00
Santhosh Manohar 185fd8d362 Enable ping for service vip address
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-10-27 12:36:41 -07:00
Santhosh Manohar 16df588f51 Add sandbox API for task insertion to service LB and service discovery
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-10-25 05:41:44 -07:00
Jana Radhakrishnan c254f3f59c Fix map access race in populatedEndpoints
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-10-18 10:20:05 -07:00
Santhosh Manohar 752f15e630 Check for ExecFunc failure
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-09-21 13:53:08 -07:00
msabansal 52d17c5717 DNS support
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-09-20 13:02:02 -07:00
Santhosh Manohar 44f6be4cbb Revert "Add sandbox API for task insertion to service LB and service discovery"
This reverts commit 2fb2fd20c7.

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-09-14 08:44:20 -07:00
Madhu Venugopal 971c5e04b8 Merge pull request #1441 from sanimej/ndots2
Drop queries in root domain when ndots is set
2016-09-12 15:16:18 -07:00
Santhosh Manohar e51268a429 Drop queries in root doamin when ndots is set
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-09-12 14:25:05 -07:00
Madhu Venugopal 8ce4ba9f9e Merge pull request #1416 from sanimej/health
Add sandbox method for task insertion to service LB and service disovery
2016-09-10 05:55:14 -07:00
Santhosh Manohar 2fb2fd20c7 Add sandbox API for task insertion to service LB and service discovery
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-09-08 17:39:45 -07:00
Alexander Morozov 7ec2214763 add missed defer to unlock
Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-09-08 12:22:20 -07:00
Jana Radhakrishnan 03460125a7 Do not hold sandbox if not in distributed control
When the libnetwork controller is not in distributed control mode avoid
retaining stale sandboxes when the network cannot be retrieved from
store. This ratining logic is only applicable for an independent k/v
store which manages libnetwork state. In such case the k/v store may be
temporarily unavailable so there is a need to retain the sandbox so that
the resource cleanup happens properly.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-01 14:32:27 -07:00
Santhosh Manohar 321f0bc2a5 Relax SRV name validation and fix external SRV query handling
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-14 11:27:07 -07:00
Santhosh Manohar f5c73b8281 Fix a panic introduced by #1389
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-11 17:51:13 -07:00
Santhosh Manohar 23f61031f4 For service name DNS resolution prioritize IP on user overlay network
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-10 17:44:33 -07:00
Madhu Venugopal aa0d3903c6 Better error handling in restoring sandbox states
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-27 00:55:46 -07:00
Vladislav Kolesnikov 61e0d2bdac added locks for all other accesses to controller.svcRecords
Signed-off-by: Vladislav Kolesnikov <vkolesnikov@beget.ru>
2016-07-20 19:49:59 +03:00
Vladislav Kolesnikov dc6e2d4121 added mutex on read from controller.svcRecords map
Signed-off-by: Vladislav Kolesnikov <vkolesnikov@beget.ru>
2016-07-20 17:28:32 +03:00
Madhu Venugopal ce16e4312e Add Virtual-IP of an endpoint as a secondary IP
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-12 15:50:42 -07:00
Jana Radhakrishnan 3dd4f07cc3 Do not add loadbalancer to unpopulated sandboxes
When adding a loadbalancer to a sandbox, the sandbox may have a valid
namespace but it might not have populated all the dependent network
resources yet. In that case do not populate that endpoint's loadbalancer
into that sandbox yet. The loadbalancer will be populated into the
sandbox when it is done populating all the dependent network resources.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-15 19:58:33 -07:00
Santhosh Manohar 5e23f3ac9b Setup external DNS servers after daemon restart with live-restore
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-06-09 20:30:01 -07:00
Lei Jitang be153a13e4 Add network restore to support docker live restore container
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-06-13 23:48:00 -07:00
Jana Radhakrishnan 7f67d41bca Properly cleanup ingress sandbox in controller
When ingress sandbox is removed, properly cleanup the reference in the
controller.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-10 08:58:19 -07:00
Madhu Venugopal 6300acd39f Merge pull request #1228 from aboch/ll
Allow to program Endpoint link-local addresses
2016-06-08 18:17:42 -07:00
Alessandro Boch e3f81d62fe Allow to program Endpoint link-local addresses
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-08 15:02:34 -07:00
Jana Radhakrishnan 0c9db265d5 Add ingress load balancer
Ingress load balancer is achieved via a service sandbox which acts as
the proxy to translate incoming node port requests and mapping that to a
service entry. Once the right service is identified, the same internal
loadbalancer implementation is used to load balance to the right backend
instance.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-04 20:38:32 -07:00
allencloud 0a8d2f55db fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-05-30 18:20:52 +08:00
Jana Radhakrishnan f3ede06779 Add loadbalancer support
This PR adds support for loadbalancing across a group of endpoints that
share the same service configuration as passed in by
`OptionService`. The loadbalancer is implemented using ipvs with just
round robin scheduling supported for now.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-05-26 13:05:58 -07:00
Santhosh Manohar 4b6b13af2c Add support for SRV query in embedded DNS
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-05-19 00:27:59 -07:00
Jana Radhakrishnan 09d7547711 Add service support
Add a notion of service in libnetwork so that a group of endpoints
which form a service can be treated as such so that service level
features can be added on top. Initially as part of this PR the support
to assign a name to the said service is added which results in DNS
queries to the service name to return all the IPs of the backing
endpoints so that DNS RR behavior on the service name can be achieved.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-05-05 16:47:05 -07:00
Alessandro Boch dfbbde46bb Fix default gw logic for internal networks
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-04-28 12:04:22 -07:00