190 Commits

Author SHA1 Message Date
oilbeater
1f02326d56 delete link and ip if err when cmdAdd to avoid resource leak. 2017-11-27 15:26:07 +08:00
Dan Williams
92c634042c
Merge pull request #93 from squeed/host-device
plugins/main/host-device: generate result, fix DEL, other cleanups
2017-11-22 10:09:32 -06:00
Casey Callendrello
2c05055101
Merge pull request #81 from squeed/portmap-hairpin
portmap: support hairpin, improve performance
2017-11-15 17:34:35 +01:00
Casey Callendrello
5e830efb20 plugins/main/host-local: generate result, fix DEL, other cleanups
This plugin needed some cleaning up: it didn't generate output, and
didn't test DEL. Add those things, plus a README.
2017-11-15 16:00:32 +01:00
Casey Callendrello
d07d2aaf71 plugins/host_device: move to "main" folder 2017-11-13 18:50:20 +01:00
Rakesh Kelkar
47668f6d64 host-local: Update host-local IPAM to support Windows 2017-11-11 15:17:45 -08:00
Gabriel Rosenhouse
99f6be0319 Enable Windows CI (Appveyor)
- start list of linux_only plugins; ignore them when testing on Windows
- Isolate linux-only code by filename suffix
- Remove stub (NotImplemented) functions
- other misc. fixes for Windows compatibility
2017-11-10 08:09:29 -08:00
Casey Callendrello
5576f3120e portmap: support hairpin, improve performance
This change improves the performance of the portmap plugin and fixes
hairpin, when a container is mapped back to itself.

Performance is improved by using a multiport test to reduce rule
traversal, and by using a masquerade mark.

Hairpin is fixed by enabling masquerading for hairpin traffic.
2017-11-10 16:56:52 +01:00
Roman Mohr
cc71426592 Don't let DHCP delete fail on missing lease
There are at least two reasons why a lease is not present:

 * The dhcp ipam daemon was restarted
 * On add the IPAM plugin failed

Don't fail the IPAM invocation when the lease is not present, to allow
proper device cleanup on CNI delete invocations.
2017-10-11 14:29:16 +02:00
Gabriel Rosenhouse
c238c93b5e host-device plugin: result is valid JSON
test:
- feed valid config JSON to plugin
- execute plugin inside the namespace with the test device
2017-09-12 21:01:58 -07:00
Gabriel Rosenhouse
25ca6ccb52 host-device: do not swallow netlink errors 2017-09-12 20:53:35 -07:00
Lantao Liu
5e46a66c89 Fix go get github.com/containernetworking/plugins.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-09-12 05:08:38 +00:00
Casey Callendrello
6be2e8a0e2 Merge pull request #3 from trusch/master
added host-device plugin which adds a specified link to container
2017-09-11 18:51:21 +02:00
Gabriel Rosenhouse
d8f2fd7a3c testing: move echosvr into testutils 2017-09-06 19:10:48 -07:00
Dan Williams
1396ab0bab Merge pull request #63 from squeed/v6-fixes
Fix ipmasq teardown on v6-only interfaces
2017-09-06 15:36:24 -05:00
Casey Callendrello
7a62515407 pkg/ip: Fix ipmasq teardown on v6-only interfaces 2017-09-06 20:02:41 +02:00
Gabriel Rosenhouse
008024125a portmap integration test: echo server runs in separate process
this way we're not mixing goroutines and namespaces
2017-09-05 23:36:12 -07:00
Gabe Rosenhouse
2f957864ea host-local disk backend store uses FileLock by reference
- this change fixes go vet warnings for the package
2017-08-30 06:52:29 -07:00
Casey Callendrello
a124fb36e6 bridge: various fixes
* Don't set the MAC, send gratuitous arp instead
* Set the bridge's MAC to itself
* Only disable DAD when necessary
2017-08-28 18:12:49 +02:00
Dan Williams
7480240de9 Merge pull request #50 from squeed/host-local-multi
ipam/host-local: support sets of disjoint ranges
2017-08-11 11:59:55 -05:00
Casey Callendrello
27d027a6d3 ipam/host-local: support sets of disjoint ranges
In real-world address allocations, disjoint address ranges are common.
Therefore, the host-local allocator should support them.

This change still allows for multiple IPs in a single configuration, but
also allows for a "set of subnets."

Fixes: #45
2017-08-09 19:02:08 +02:00
Dan Williams
998a0f6c6a tuning: pass prevResult through 2017-07-26 14:39:01 -05:00
Tom Denham
a714098daf Merge pull request #35 from dnardo/bridge-plugin
bridge: add support for promiscuous mode
2017-07-12 08:30:00 -07:00
Casey Callendrello
3745ee2d3f plugins/portmap: fix test flake
The source address selection was random, and sometimes we picked a
source address that the container didn't have a route to. Adding a
default route fixes that!
2017-07-06 16:12:24 +02:00
Dan Williams
0b9dbef185 ptp: fix testcase for Interface int-pointer changes 2017-07-05 16:26:19 -05:00
Daniel Nardo
9d08b04a3a bridge: add support for promiscuous mode 2017-07-05 09:51:10 -07:00
Casey Callendrello
a690f775ae Merge pull request #25 from squeed/ptp-v6
ptp: add ipv6 support
2017-07-05 17:30:23 +02:00
Casey Callendrello
3daee3214d ptp: add ipv6 support
* Wait for addresses to leave tentative state before setting routes
* Enable forwarding correctly
* Set up masquerading according to the active protocol
2017-06-30 12:06:57 +02:00
Dan Williams
0da6780449 pkg,plugins: update for Result struct Interface index changes
It's a pointer now, so we need to use the helper function to set
the field and also test for nil before accessing it.
2017-06-29 13:40:36 -05:00
Tino Rusch
ca3f28fa9e
host-device: cleanup + completed tests; 2017-06-29 11:44:59 +02:00
Dan Williams
5a7a8b3069 Merge pull request #24 from squeed/flannel-return
flannel: set the cniVersion on the delegated config
2017-06-28 08:45:02 -05:00
Dane LeBlanc
ffdc748861 bridge: Add support for IPv6 to bridge plugin
This change adds support for IPv6 container/pod addresses to the CNI
bridge plugin, both for dual-stack (IPv4 + IPv6) and for IPv6-only
network configurations.

The proposed changes support multiple IPv6 addresses on a container
interface. If isGW is configured, the bridge will also be configured with
gateway addresses for each IPv6 subnet.

Please note that both the dual-stack functionality and support for multiple
IPv6 container/gateway addresses depends upon containernetworking/cni
PR 451 "ipam/host-local: support multiple IP ranges".
This change could potentially be committed independently from this host-local
plugin change, however the dual-stack and multiple IPv6 address
functionality that is enabled by this change can't be exercised/tested
until the host-local plugin change is committed.

There are some IPv6 unit test cases that are currently commented out
in the proposed changes because these test cases will fail without the
prior commits of the multiple IP range host-local change.

This pull request includes a temporary workaround for Kubernetes
Issue #32291 (Container IPv6 address is marked as duplicate, or dadfailed).
The problem is that kubelet enables hairpin mode on bridge veth
interfaces. Hairpin mode causes the container/pod to see echos of its
IPv6 neighbor solicitation packets, so that it declares duplicate address
detection (DAD) failure. The long-term fix is to use enhanced-DAD
when that feature is readily available in kernels. The short-term fix is
to disable IPv6 DAD in the container. Unfortunately, this has to be done
unconditionally (i.e. without a check for whether hairpin mode is enabled)
because hairpin mode is turned on by kubelet after the CNI bridge plugin
has completed cmdAdd processing. Disabling DAD should be okay if
IPv6 addresses are guaranteed to be unique (which is the case for
host-local IPAM plugin).
2017-06-21 12:47:38 -04:00
Casey Callendrello
8c5e754617 flannel: set the cniVersion on the delegated config
Fixes: #23
2017-06-16 19:04:07 +02:00
Casey Callendrello
5bbff37294 Merge pull request #16 from squeed/gratuitous-arp
ptp, macvlan: don't change mac address; send gratuitous arp
2017-06-16 18:34:37 +02:00
Casey Callendrello
485f151536 Merge pull request #22 from squeed/portmap-plugin
portmap: Don't accept a port number of 0
2017-06-16 18:33:40 +02:00
Gabe Rosenhouse
494053dd98 Merge pull request #11 from dcbw/dhcp-pidfile
dhcp: add --pidfile option to DHCP client daemon
2017-06-15 22:48:42 -07:00
Casey Callendrello
83ec9bb73f portmap: Don't accept a port number of 0
This also adds more testing around configuration parsing.
2017-06-15 14:00:04 +02:00
Dan Williams
a38dd5f7a0 dhcp: add --pidfile option to DHCP client daemon 2017-06-14 21:41:43 -05:00
Casey Callendrello
2e9e87732f ipam/host-local: support multiple IP ranges
This change allows the host-local allocator to allocate multiple IPs.
This is intended to enable dual-stack, but is not limited to only two
subnets or separate address families.
2017-06-12 21:14:44 +02:00
Casey Callendrello
e76165b44f ptp, macvlan: don't change mac address; send gratuitous arp 2017-06-07 16:08:41 +02:00
Casey Callendrello
43a24515ee build: some minor post-repo-split fixes; add fastbuild 2017-06-01 18:51:46 +02:00
Casey Callendrello
a7aaf0e377 plugins/meta/portmap: add an iptables-based host port mapping plugin 2017-06-01 10:06:28 +02:00
Casey Callendrello
3c436520be move most of cni/pkg to plugins/pkg: delete code staying in cni/pkg
This moves the following packages to this repository:
* ip
* ipam
* ns
* testutils
* utils
2017-05-23 16:12:49 +02:00
Casey Callendrello
9f52fc0374 Move documentation folder to individual READMEs 2017-05-16 16:46:15 +02:00
Dan Williams
d2792f264e plugins: add plugins from containernetworking/cni
Plugins prepared from the containernetworking/cni repo as follows:

1) git reset --hard 1a9288c3c09cea4e580fdb1a636f1c5e185a391f
2) git remove everything not in plugins/
3) git remove plugins/test
4) git merge into containernetworking/plugins repo
5) adjust import paths for containernetworking/cni -> containernetworking/plugins
2017-05-14 23:12:45 -05:00
Dan Williams
4e0349a7e7 Remove everything except for plugins in preparation for import to plugins repo 2017-05-14 23:04:53 -05:00
Dan Williams
4af68521cd plugins: move vlan to plugins/main/ 2017-05-09 22:47:26 -05:00
Pengfei Ni
f197c01b62 Fix testings accross the project
Signed-off-by: Pengfei Ni <feiskyer@gmail.com>
2017-05-03 23:21:44 +08:00
Tino Rusch
f2faf549b4
[host-device] integrated getLink() function which maps either devicename, hw-addr or kernelpath to a link object; 2017-05-02 13:21:50 +02:00
Tino Rusch
6099d8c84c
added host-device plugin which adds a specified link to the container network namespace; 2017-04-28 09:34:22 +02:00