Bryan Boreham
6ef302b8a1
Extract FindBridgeIP to net package
2016-12-23 11:57:04 +00:00
Bryan Boreham
a07e3301b1
Add 'weave expose' NAT iptables rules inside CNI plugin
...
This avoids a race between the plugin and the script
2016-11-14 12:37:42 +00:00
Bryan Boreham
2b4d13c5b1
Don't error on bridge address already there
2016-11-14 12:37:42 +00:00
Marc CARRE
0544901357
Factorise "_" duplicates as a constant.
2016-11-11 17:00:26 +00:00
Martynas Pumputis
e611f04f41
Move NetDev utils from common/ to net/
2016-10-19 17:03:30 +01:00
Martynas Pumputis
3492cd93d0
Use safe version of WithNetNS
2016-10-19 16:15:59 +01:00
Bryan Boreham
b38a55ca7c
Include more context in error messages from CNI operations
2016-10-18 17:45:09 +01:00
Martynas Pumputis
4a49ff3083
Replace usage of WithNetNSUnsafe in plugin/net/watcher.go with safer version
...
Unsafe version was in ConfigureARPforVeths; replacement is via `weaveutil configure-arp`
2016-10-06 15:25:05 +01:00
Adam Harrison
5cc0826ca0
Merge branch '1.6'
2016-08-10 13:16:24 +01:00
Bryan Boreham
081b95dfd0
CNI plugin assigns an IP to the bridge by itself
...
No need to call `weave expose` before use.
2016-08-08 15:28:26 +01:00
Bryan Boreham
88bf64722f
Merge branch '1.6'
2016-07-12 10:33:38 +00:00
Martynas Pumputis
89221f117b
Denote WithNetNS* functions with unsafe
...
Please see https://github.com/weaveworks/weave/issues/2388#issuecomment-228365069
for more details.
2016-07-05 15:12:39 +01:00
Martynas Pumputis
05baa566c6
Refactor common.GetBridgeNetDev
...
- Optimize. Use LinkByName instead of iterating over list of available
links. Linux does not support interfaces with the same names.
- Remove unnecessary indirection in utility functions which return
common.NetDev.
2016-07-05 15:12:39 +01:00
Matthias Radestock
954cd0b86a
Merge branch '1.6'
2016-07-04 16:27:59 +01:00
Matthias Radestock
0635ed1854
highlight the need for weave expose in CNI/k8s ( #2411 )
...
* highlight the need for `weave expose` in CNI/k8s
Fixes #2405
* Extend error message
* rearranged the sentences
weave launch <peer hosts> seems a bit orphaned here maybe include the weave connect command as well, since it's being mentioned.
2016-07-04 16:27:11 +01:00
Bryan Boreham
afe882cd94
Use more chars from endpointID to reduce clashes in veth names
...
Import library to get max name length IFNAMSIZ
2016-07-01 16:05:02 +01:00
Bryan Boreham
ceb5f8c714
Move endpoint creation into CreateEndpoint so we can return the MAC address
2016-06-29 17:38:07 +01:00
Bryan Boreham
8bb8f70bb6
Perform arp configuration for plugin-connected containers
2016-06-14 17:53:34 +01:00
Bryan Boreham
c71c630cf6
Use driver name to detect 'our' endpoints
...
so we don't have to remember all the endpoint IDs, or load them up
after a restart.
2016-06-14 17:52:45 +01:00
Martynas Pumputis
7670fed72c
Add AWSVPC setup routines to the attach script
...
When running in the AWSVPC mode, we need to do the following:
- Keep the HW TX offloading on.
- Check that the allocated address belongs to the default subnet,
because only one subnet is allowed and it should be the default one.
If it is not possible to determine whether AWSVPC is on, we ignore
all the steps, because the attachment routines have to work
regardless whether the router is running and the AWSVPC detection
is done by querying the /ipinfo/tracker endpoint served by
the router.
2016-06-08 16:44:54 +01:00
Bryan Boreham
a1c3cba363
Invert multicast option in plugin
...
Now it's off by default, and there is an option to enable the
multicast route per-network.
We turn it on for the `weave` network created when we start the plugin.
2016-06-02 12:52:30 +01:00
Adam Harrison
c9525532ea
Merge branch '1.5'
...
Closes #2300
2016-05-26 16:08:14 +01:00
Bryan Boreham
fd257f43d1
Don't release fake gateway address
...
Watch out for Docker releasing the fake gateway address we create when
the network is set up, and don't pass it on to Weave IPAM.
2016-05-26 12:30:03 +00:00
Bryan Boreham
6dd109a5bb
Only do ethtool tx off in bridged (pcap) mode.
...
Detect the bridge type in the same way the weave script does.
2016-05-25 17:34:13 +01:00
Bryan Boreham
2702b85ee5
Improve veth name construction; use a constant instead of "ethwe"
2016-05-25 17:34:13 +01:00
Bryan Boreham
8717fd15ed
Use 'peer' and 'veth' instead of 'guest' and 'local', after review comments
2016-05-25 17:34:13 +01:00
Bryan Boreham
ac14b19db8
Move attach() and detach() from shell script to Go
2016-05-25 17:34:13 +01:00
Bryan Boreham
4fc2835d92
Extract AddRoute function
2016-05-25 17:29:45 +01:00
Bryan Boreham
85023e0a76
Extract AttachContainer() function
...
Also move netlink and netns code from common to net
Creates interface if not already there
Adds addresses
Move the set link 'up' to after addresses are added
2016-05-25 17:29:45 +01:00
Bryan Boreham
0257274aa8
Extract basic veth setup
2016-05-25 17:23:49 +01:00
Bryan Boreham
9aaa7f19fd
initialize via sub-function
2016-05-25 17:17:19 +01:00
Bryan Boreham
9f8b94645d
Obtain IP address before setting up veth
2016-05-25 17:17:19 +01:00
Bryan Boreham
c458deaf80
Slight cleanup
2016-05-25 17:17:19 +01:00
Bryan Boreham
f11d91badf
Extract veth creation and LinkSetUp to net package
2016-05-25 17:17:19 +01:00
Bryan Boreham
ede00047db
Send out arp update from CNI plugin
2016-05-25 12:05:20 +01:00
Adam Harrison
df2868fcdd
Plugin README links refer to latest release docs
2016-05-05 16:32:53 +01:00
Matthias Radestock
a5739e8753
make plugin README link to other docs on github rather than website
...
until we have stable (non-version-specific) links for the latter.
Stop-gap for #2214 .
2016-04-26 14:06:40 +01:00
Matthias Radestock
d1ca38e106
Merge pull request #2148 from weaveworks/issues/2146-cni-sock
...
Bind-mount the docker socket for CNI plugin
Fixes #2146
2016-04-11 16:03:14 +01:00
Bryan Boreham
c6e8f54fe7
Add CNI plugin to description
2016-04-11 11:31:25 +01:00
Bryan Boreham
13f3ff15bd
Sanity-check ipam args to make diagnosis easier
2016-04-08 15:18:08 +01:00
Matthias Radestock
4482d307bf
tweak ipam plugin logging
...
- log requests at info level instead of debug level
- log errors at error level instead of debug level
2016-03-24 18:52:55 +00:00
Matthias Radestock
5aa2a7a14c
refactor(ish) of ipam plugin logging
...
prefix all log entries with "[ipam]"
Also eliminate a dot import.
2016-03-24 18:52:55 +00:00
Matthias Radestock
984cad5b58
clean up network plugin logging
...
Consistency, consistency, consistency:
- prefix all log messages with "[net]" - important since the same
process acts as both a network and ipam driver
- include the API function name in all log messages
- log request and response details at debug level
- log request summary at info level
- log ContainerStarted as a pseudo API function, but only at debug
level (since it can be quite high volume)
And eliminate some dot imports.
2016-03-24 18:52:44 +00:00
Matthias Radestock
de8c1d262f
don't error log in 'createAndAttach'
...
It is a library function, so logging of any errors should be left to
the caller.
We also get rid of a logged warning which contained the complete data
structure returned by netlink.LinkByName.
So this function now does no logging at all. Which is how it should be.
2016-03-24 18:52:07 +00:00
Matthias Radestock
2d964bdc95
don't log in cni; just return errors
...
CNI is invoked from the command line; so there is no point in getting
clever about logging.
2016-03-24 18:51:34 +00:00
Matthias Radestock
91044ac0fa
cosmetic: consistency
2016-03-24 18:51:08 +00:00
Matthias Radestock
98aeb674c4
cosmetic: more plugin error message/logging tweaks
2016-03-24 18:41:47 +00:00
Matthias Radestock
ea11c5eedc
cosmetic: some error logging message tweaks
2016-03-24 18:16:57 +00:00
Matthias Radestock
c146ee142d
Merge branch '1.4'
2016-03-24 17:26:00 +00:00
Matthias Radestock
fce954192c
fail plugin operation on bridge attachment error
...
Fixes #2097 .
2016-03-24 17:01:15 +00:00