Commit Graph

665 Commits

Author SHA1 Message Date
a11cb626b0 Merge pull request #331 from nagiesek/LoopbackDsr
Loopback dsr & L2Tunnel
2019-08-07 17:48:00 +02:00
8902d2614a Remove link Down/Up in MAC address change to prevent route flush 2019-08-07 13:54:10 +09:00
df9af9ab41 [Windows] Adds optional loopbackDSR argument to cni config.
Adds a bool to the cni config that will add a policy that allows for loopbackDSR on an interface. Updates relevant documentation. Allows L2Tunnel networks to be used for L2Bridge plugin.
2019-07-31 15:45:54 -07:00
5e2e365291 host-device: remove useless Expects in testcases
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-29 21:09:03 +08:00
4b68f56820 host-device: add testcases for imdempotence of CmdDel
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-29 20:47:28 +08:00
ded2f17577 Merge pull request #328 from mars1024/feature/hostlocal_idempotent
host-local support idempotent allocation
2019-07-24 17:32:15 +02:00
57650a1e5b host-device: revert name setting to make retries idempotent
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-19 21:26:07 +08:00
3fb8dcfd4c pkg/meta/bandwidth: increase IfbDeviceName size
* Increase entroy from 2 bytes to 7 bytes to prevent collisions
* Extract common library function for hash with prefix
* Refactor portmap plugin to use library function

fixes #347

Co-authored-by: Cameron Moreau <cmoreau@pivotal.io>
Co-authored-by: Mikael Manukyan <mmanukyan@pivotal.io>
2019-07-18 11:45:38 -07:00
e2984e7840 host-local: return error if duplicate allocation is requested for a given ID
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-06 10:05:18 +08:00
eb1ff18c4c host-local: add some testcases for allocation idempotency
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-06 09:39:56 +08:00
e8771b36a2 host-local: make allocation idempotent to multiple requests with same id
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-06 09:39:56 +08:00
7f8ea631e5 host-local: make Store interface support to get ip list by id
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-06 09:39:56 +08:00
660685a8af Support ips capability in static and mac capability in tuning
This change introduces new capability flag to change MAC address
and to specify IP addresses by tuning and static.
2019-06-20 17:11:47 +09:00
869d5ec873 pkg/ipam : use delegateArgs instead of env set/unset in ipam.ExecDel
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-06-18 21:02:01 +08:00
e308211d34 Merge pull request #300 from zshi-redhat/host-device-pci-parameter
host-device: add pciBusID property
2019-05-29 11:06:00 -05:00
7d75ab66a4 Merge pull request #321 from mars1024/modify/bandwidth
bandwidth: get bandwidth interface in host ns through container interface
2019-05-29 17:57:36 +02:00
37d2ee1d5d bridge: don't use canonical CIDR address when setting up IP masquerade 2019-05-25 20:55:47 -04:00
7f9b1844b8 bridge: add test for ipMasq rules 2019-05-24 23:14:31 -04:00
d35c96dda6 bandwidth: add testcases for func getHostInterface
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-05-21 00:28:04 +08:00
344d343431 bandwidth: get bandwidth interface in host ns through container interface
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-05-18 14:06:45 +08:00
0950a3607b Merge pull request #279 from mars1024/bugfix/ipmasq_source
change source of ipmasq rule from ipn to ip
2019-05-10 13:40:17 +02:00
02ccf1ef9b Have ipam.ExecDel set CNI_COMMAND to DEL 2019-05-08 11:50:28 -04:00
a03e6b505e Merge pull request #307 from SchSeba/l2-macvlan
Allow to configure empty ipam for macvlan
2019-05-08 17:27:52 +02:00
6bceb68143 Merge pull request #309 from nagiesek/flannel
Flannel: Pass through runtimeConfig to delegate
2019-05-08 10:25:50 -05:00
071907f867 Flannel: pass runtimeConfig into delegate 2019-05-01 15:58:24 -07:00
af692de1b8 Allow to configure empty ipam for macvlan
This PR add the option to configure an empty ipam for the macvlan cni plugin.

When using the macvlan cni plugin with an empty ipam the requeted pod will get the macvlan interface but without any ip address.

One of the use cases for this feature is for projects that runs a dhcp server inside the pod like KubeVirt.
In KubeVirt we need to let the vm running inside the pod to make the dhcp request so it will be able to make a release an renew request when needed.
2019-05-01 20:29:22 +03:00
ae0b03787f windows,flannel: cmdGet -> cmdCheck and fix flannel Check return 2019-05-01 10:48:14 -05:00
dbc86e4db2 Merge pull request #298 from s1061123/dev/macvlan-default-master
macvlan: make master config as optional
2019-04-30 15:47:51 +02:00
7efec9ea46 change source of ipmasq rule from ipn to ip 2019-04-25 15:59:02 +08:00
79b1c402c4 host-device: add deviceID property
Fixes #253
2019-04-25 12:17:40 +08:00
cc4976a43c return nil instead of error for cmdCheck until support is added 2019-04-24 13:47:58 -04:00
827a4bd843 Merge pull request #301 from mars1024/bugfix/ipam_revert
fix bug on ip revert if cmdAdd fails on macvlan and host-device
2019-04-24 10:36:40 -05:00
214bcb8c8b fix bug on ipam revert if cmdAdd fails on macvlan and host-device 2019-04-18 21:16:29 +08:00
635968aaff Merge branch 'master' into noErrorEndpointNotFound 2019-04-17 23:04:04 -07:00
7924ef76da Incorporate with reviewer's comments 2019-04-18 00:54:31 +09:00
688a87a055 Windows: No error for no endpoint found On Del. Ipam clean-up on ADD failure.
We used to return error if no endpoint was found during delete. We now treat this as a success. If we fail during an add call, we now make a delete delegate call to the ipam to clean-up.
2019-04-17 08:33:10 -07:00
8c52f50849 macvlan: make master config as optional
To ease of config, make master config as optional parameter.
In default case, default route interface will be used for master.
2019-04-17 16:28:27 +09:00
72f2a1ffd4 plugins: correctly output build version, cosmetic cleanups
Now that libcni has the ability to print a version message, plumb it
through correctly.

While we're at it,
- fix import paths
- run gofmt
- add some more comments to sample
- add container runtime swappability for release
2019-04-15 16:52:07 +02:00
d47387c6fe Add Check support to firewall meta plugin, test cases 2019-04-12 14:37:21 -04:00
95be5da5e2 firewall: add a couple more testcases 2019-04-12 14:37:21 -04:00
b46e1a0138 firewall: consolidate firewalld code into firewall plugin 2019-04-12 14:37:21 -04:00
9d6f1e9975 firewall: add firewalld functionality to firewall plugin
Example of usage, which uses flannel for allocating IP
addresses for containers and then registers them in `trusted`
zone in firewalld:

{
  "cniVersion": "0.3.1",
  "name": "flannel-firewalld",
  "plugins": [
    {
      "name": "cbr0",
      "type": "flannel",
      "delegate": {
        "isDefaultGateway": true
      }
    },
    {
      "type": "firewall",
      "backend": "firewalld",
      "zone": "trusted"
    }
  ]
}

Fixes #114

Signed-off-by: Alban Crequy <alban@kinvolk.io>
Signed-off-by: Michal Rostecki <mrostecki@suse.com>
2019-04-12 14:37:21 -04:00
d096a4df48 firewall: new plugin which allows a host interface to send/receive traffic
Distros often have additional rules in the their iptabvles 'filter' table
that do things like:

-A FORWARD -j REJECT --reject-with icmp-host-prohibited

docker, for example, gets around this by adding explicit rules to the filter
table's FORWARD chain to allow traffic from the docker0 interface.  Do that
for a given host interface too, as a chained plugin.
2019-04-12 14:37:21 -04:00
e9e1d37309 Merge pull request #231 from SchSeba/add-vlan-tag-to-bridge
Added vlan tag to the bridge cni plugin.
2019-04-11 11:58:33 -05:00
b69a2dd3d7 Added vlan tag to the bridge cni plugin.
With the VLAN filter, the Linux bridge acts more like a real switch, Allow to tag and untag
vlan id's on every interface connected to the bridge.

This PR also creates a veth interface for the bridge vlan interface on L3 configuration.

Related to https://developers.redhat.com/blog/2017/09/14/vlan-filter-support-on-bridge/ post.

Note: This feature was introduced in Linux kernel 3.8 and was added to RHEL in version 7.0.
2019-04-10 21:59:52 +03:00
fbd9accd14 Merge pull request #268 from s1061123/fix/dhcp_daemon_hostprefix
Fix -hostprefix option
2019-04-08 12:53:09 +02:00
8b53f80fa8 Incorporate with @bboreham comment 2019-04-05 03:38:20 +09:00
18874aac7d Merge pull request #264 from mccv1r0/add-check
Add CHECK support for linux plugins
2019-04-03 12:58:41 -05:00
74a2596573 Add check support for: bridge, ipvlan, macvlan, p2p, vlan and host-device main plugins
host-local and static ipam plugins
  tuning, bandwidth and portmap meta plugins

  Utility functions created for common PrevResult checking

  Fix windows build
2019-04-03 13:08:07 -04:00
8a3d149a60 Merge pull request #284 from francares/fmc_dhcp_subnetmask
IPAM/DHCP: include Subnet Mask option parameter in DHCPREQUEST
2019-04-01 14:56:13 -05:00