Commit Graph

84 Commits

Author SHA1 Message Date
Casey Callendrello
e4eaad3d24 kubelet/networking: add support for cni ConfigLists, pass hostport parameters
** reason for this change **
CNI has recently introduced a new configuration list feature. This
allows for plugin chaining. It also supports varied plugin versions.
2017-04-18 14:23:57 +02:00
Andy Goldstein
2c30dc1a60 ConstructPodPortMapping: move & export
Move ConstructPodPortMapping to pkg/kubelet/network/hostport and export
it so downstream projects (such as OpenShift) can use it.
2017-04-06 13:47:33 -04:00
Minhan Xia
f006c8bcd3 teach kubenet to use annotation instead of pod object for traffic shaper 2017-02-27 10:11:09 -08:00
Minhan Xia
947e0e1bf5 pass pod annotation to SetUpPod 2017-02-27 10:09:45 -08:00
Minhan Xia
6b34343946 bug fix for hostport-syncer 2017-02-22 16:38:09 -08:00
Minhan Xia
be9eca6b51 teach kubenet to use hostport_manager 2017-02-08 09:35:04 -08:00
Minhan Xia
51526d3103 Add checkpointHandler to DockerService 2017-02-02 10:19:34 -08:00
Minhan Xia
548a6122c5 rename HostportHandler to HostportSyncer 2017-01-30 16:30:06 -08:00
Minhan Xia
8e318b8d9b refactor hostport logic 2017-01-25 14:52:33 -08:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Pengfei Ni
25dee7dd83 kubenet: define KubenetPluginName for all platforms 2016-12-29 15:39:16 +08:00
Minhan Xia
ff6cdeb9b8 clean up logic that configs TX queue length 2016-12-27 14:43:47 -08:00
Chao Xu
5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
bprashanth
aee5b8099c Skip legacy features (hostport, bwshaping) 2016-10-31 13:05:19 -07:00
bprashanth
48db726342 Split network.Host into LegacyHost and NamespaceGetter 2016-10-31 13:05:19 -07:00
bprashanth
37bc34c567 periodically GC pod ips 2016-10-27 22:15:35 -07:00
Dan Williams
e2c96db72b kubenet: make it more apparent that kubenet ignores PodCIDR updates
https://github.com/kubernetes/kubernetes/issues/32900
2016-10-05 11:24:02 -05:00
Kubernetes Submit Queue
9c5bf904c2 Merge pull request #32217 from freehan/kubenetcheck
Automatic merge from submit-queue

nit fixes

Do not merge yet. Wait till it gets bigger. 

fix included:
1. use golang native util to list dir
2016-09-24 03:28:28 -07:00
Yifan Gu
5389a74388 kubenet: SyncHostports for both running and ready to run pods.
This fixes the race that happens in rktnetes when pod B invokes
'kubenet.SetUpPod()' before another pod A becomes actually running.

The second 'kubenet.SetUpPod()' call will not pick up the pod A
and thus overwrite the host port iptable rules that breaks pod A.

This PR fixes the case by listing all 'active pods' (all non-exited
pods) instead of only running pods.
2016-09-16 17:29:44 -07:00
Minhan Xia
8031c8d97b use golang native util to list dir 2016-09-07 10:42:27 -07:00
Kubernetes Submit Queue
2a7d0df30d Merge pull request #30727 from asalkeld/iptables-caps
Automatic merge from submit-queue

Clean up IPTables caps i.e.: sed -i "s/Iptables/IPTables/g"

Fixes #30651
2016-09-06 09:01:27 -07:00
Kubernetes Submit Queue
1e21eda604 Merge pull request #31197 from freehan/kubenethairpin
Automatic merge from submit-queue

Deprecate the old cbr0 and flannel networking modes

fixes: #19766
2016-09-02 18:51:05 -07:00
Minhan Xia
fd4c947de9 correct typo in kubenet config 2016-09-02 14:33:34 -07:00
Minhan Xia
20ed879faa kubenet checks required cni plugins are present 2016-09-01 17:16:05 -07:00
Angus Salkeld
f785f3d3ef Clean up IPTables caps i.e.: sed -i "s/Iptables/IPTables/g" 2016-08-29 10:34:42 +10:00
Minhan Xia
42a554ec0d add ebtables rules to filter duplicate packets 2016-08-24 10:19:29 -07:00
Minhan Xia
950e689637 kubenet set cbr0 mac address 2016-08-24 10:18:48 -07:00
Justin Santa Barbara
902ba4e249 Add network-plugin-mtu option for MTU selection
MTU selection is difficult, and if there is a transport such as IPSEC in
use may be impossible.  So we allow specification of the MTU with the
network-plugin-mtu flag, and we pass this down into the network
provider.

Currently implemented by kubenet.
2016-08-23 01:50:58 -04:00
Justin Santa Barbara
2c103af2b6 Create testable implementation of sysctl
This is so we can test kubenet Init, which calls sysctl
2016-08-23 01:42:37 -04:00
Wojciech Tyczynski
0459574450 Revert "Use netlink.SetPromiscOn instead of iproute2 command" 2016-08-22 10:28:11 +02:00
Kubernetes Submit Queue
ada5669c7f Merge pull request #30346 from dshulyak/promisc
Automatic merge from submit-queue

Use netlink.SetPromiscOn instead of iproute2 command

Depends on https://github.com/vishvananda/netlink/pull/157
Related https://github.com/kubernetes/kubernetes/issues/26093
2016-08-21 23:34:21 -07:00
Minhan Xia
85b2f9047a update godep to pull from containernetworking/cni 2016-08-19 13:31:50 -07:00
Dmitry Shulyak
b79a12c7ce Use netlink.SetPromiscOn instead of iproute2 command 2016-08-14 14:58:14 +03:00
Bryan Boreham
26a53fcd47 Use the CNI bridge plugin to set hairpin mode
Pass the flag down in kubenet, and disable it in DockerManager
2016-07-14 17:52:51 +01:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot
8ed6c8eeb8 Merge pull request #27914 from yifan-gu/fix_kubenet_hostport
Automatic merge from submit-queue

kubenet: Fix host port for rktnetes.

Because rkt pod runs after plugin.SetUpPod() is called, so
getRunningPods() does not return the newly created pod, which
causes the hostport iptable rules to be missing for this new pod.

cc @dcbw @freehan 

A follow up fix for https://github.com/kubernetes/kubernetes/pull/27878#issuecomment-227898936
2016-06-23 18:48:45 -07:00
Yifan Gu
9140ce07bc kubenet: Fix host port for rktnetes.
Because rkt pod runs after plugin.SetUpPod() is called, so
getRunningPods() does not return the newly created pod, which
causes the hostport iptable rules to be missing for this new pod.
2016-06-23 13:17:01 -07:00
Minhan Xia
48169ce736 avoid deleting cbr0 address due to subnet string mismatch 2016-06-22 16:45:04 -07:00
Dan Williams
e47d020cb6 kubelet/kubenet: simplify getting nsenter path 2016-06-22 14:26:11 -05:00
Dan Williams
a657d0587b kubelet/kubenet: Fix getRunningPods() to support rkt pods
Don't assume there's an infra container.
2016-06-22 13:45:13 -05:00
Dan Williams
db078dbea4 kubelet/cni/kubenet: use common container IP address functions 2016-06-22 11:36:10 -05:00
Dan Williams
a519e8a403 kubenet: clean up networking when setup errors occur
Relying on the runtime to later call cleanup is fragile, so make sure
that everything gets nicely cleaned up when setup errors occur.
2016-06-16 13:53:28 -05:00
Dan Williams
965492fdd0 kubelet/kubenet: split hostport handling into separate module 2016-06-16 13:44:32 -05:00
k8s-merge-robot
805a0aae71 Merge pull request #27141 from freehan/hpfix
Automatic merge from submit-queue

only handled non host network pods for hostports in kubenet

attempt to fix: #27118
2016-06-09 22:08:10 -07:00
Minhan Xia
1276a91638 kubenet masqurade for outbound traffic 2016-06-09 18:43:34 -07:00
Minhan Xia
1b2386f1ce only handled non host network pods for hostports in kubenet 2016-06-09 11:32:16 -07:00
Minhan Xia
e9f8c70eaf pass NetworkPluginDir to kubenet 2016-06-03 10:22:49 -07:00
Euan Kemp
c83ad19ae9 kubenet: Fix ipv4 validity check
The length of an IP can be 4 or 16, and even if 16 it can be a valid
ipv4 address. This check is the more-correct way to handle this, and it
also provides more granular error messages.
2016-05-27 16:25:14 -07:00
Euan Kemp
93487867ac kubenet: Update empty ip check
The previous check was incorrect because the `IP.String` method returns
`<nil>` and other non-empty-strings on error conditions.
2016-05-27 10:47:13 -07:00
Euan Kemp
c4b8959a75 kubenet: Reduce loglevel of spammy message
When no shaping is enabled, that warning would always be printed.
2016-05-27 10:47:12 -07:00