Commit Graph

40 Commits (3ebb8ddd8a21b4b8eca05c0e4a01c91617bd245f)

Author SHA1 Message Date
Dan Williams 8cf0076e23 proxy/userspace: respect minSyncInterval and simplify locking
The userspace proxy does not have any ratelimiting and when many
services are used will hammer iptables every time a service or
endpoint change occurs. Instead build up a map of changed
services and process all those changes at once instead of each
time an event comes in. This also ensures that no long-running
processing happens in the same call chain as the OnService*
calls as this blocks other handlers attached to the proxy's
parent ServiceConfig object for long periods of time.

Locking can also now be simplified as the only accesses to the
proxy's serviceMap happen from syncProxyRules(). So instead of
locking in many functions just lock once in syncProxyRules()
like the other proxies do.

https://bugzilla.redhat.com/show_bug.cgi?id=1590589
https://bugzilla.redhat.com/show_bug.cgi?id=1689690
2019-04-05 16:28:17 -05:00
Dan Williams ddab79a233 proxy/userspace: add proxy shutdown function and use in testcases
If a testcase does time out and 'go test' prints the call stack,
make sure everything from previous tests is cleaned up so the call
stack is easier to understand.
2019-04-05 16:16:36 -05:00
x00416946 fisherxu 79e17e6cd7 use versioned api in kube-proxy 2018-08-16 09:59:33 +08:00
hzxuzhonghu 2b7fd92dce userspace: move udp echo server to proxier_test.go 2018-03-09 09:22:30 +08:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
ymqytw 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00
Wojciech Tyczynski 33a7a288a5 Switch userspace proxy to be event based for services 2017-05-05 09:35:38 +02:00
Wojciech Tyczynski 12058c6a63 Delete unused code 2017-05-05 09:35:38 +02:00
Wojciech Tyczynski c5cbdbe3d2 Edge-based userspace proxy 2017-04-10 11:59:21 +02:00
Tim Hockin adf30aa2e1 kube-proxy: OnServiceUpdate takes pointers
This signature is more consistent with OnEndpointsUpdate and removes a
copy loop.  This is part on ongoing cleanup to rate-limit iptables
calls.
2017-04-03 17:19:39 -07:00
Wojciech Tyczynski 2a6083c3e7 Avoid copying endpoints object in kube-proxy 2017-03-25 17:41:42 +01:00
Benjamin Bennett 5447db3048 Userspace proxy should remove conntrack entries
This changes the userspace proxy so that it cleans up its conntrack
settings when a service is removed (as the iptables proxy already
does).  This could theoretically cause problems when a UDP service
as deleted and recreated quickly (with the same IP address).  As
long as packets from the same UDP source IP and port were going to
the same destination IP and port, the the conntrack would apply and
the packets would be sent to the old destination.

This is astronomically unlikely if you did not specify the IP address
to use in the service, and even then, only happens with an "established"
UDP connection.  However, in cases where a service could be "switched"
between using the iptables proxy and the userspace proxy, this case
becomes much more frequent.
2017-02-27 18:41:47 -05:00
Solly Ross 655b338256 Userspace Proxy: Keep ref to service being proxied
This commit makes the userspace proxy keep an ObjectReference to the
service being proxied.  This allows the consumers of the `ServiceInfo`
struct, like `ProxySockets` to emit events about or otherwise refer to
the service.
2017-02-27 18:41:47 -05:00
Solly Ross de2285ac7b Userspace Proxy: Allow any ProxySocket in Proxier
This commit adds a new method for constructing userspace proxiers,
`NewCustomProxier`.  `NewCustomProxier` functions identically to
`NewProxier`, except that it allows a custom constructor method to
be passed in to construct instances of ProxySocket.
2017-02-27 18:41:47 -05:00
Solly Ross 43c4d7ae23 Userspace Proxy: Make ProxySocket Implementable
This commit makes it possible for the `ProxySocket` interface to be
implemented by types outside of the `userspace` package.  It mainly just
exposes relevant types and fields as public.
2017-02-27 18:41:46 -05:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Timothy St. Clair 2b012e822a Add minimum iptables sync period to the proxy, default is 2/sec 2016-11-04 00:38:35 -05:00
k8s-merge-robot 04602bb9e5 Merge pull request #28655 from freehan/kubeproxyfix
Automatic merge from submit-queue

Don't delete affinity when endpoints are empty

closes: #25316
2016-07-08 11:28:43 -07:00
Minhan Xia e1df5c8b30 fix proxy unit tests 2016-07-07 17:43:22 -07:00
bin liu 426fdc431a Merge branch 'master' into fix-typos 2016-07-04 11:20:47 +08:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
bin liu fd27cd47f7 fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-22 18:14:26 +08:00
zhouhaibing089 5923fd352e followup to add http server close method 2016-05-05 12:04:41 +08:00
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
David Oppenheimer 8ac484793d Comment out calls to httptest.Server.Close() to work around
https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
2016-01-11 23:02:11 -08:00
Tim Hockin 970c045848 Enable iptables kube-proxy by default in master 2015-11-13 18:38:01 -08:00
Abhishek Shah d172ca6986 Added UdpIdleTimeout flag 2015-10-21 17:25:35 -07:00
Dan Winship 8bc9c40796 Watch for firewalld restart, to allow reloading iptables rules 2015-09-15 11:17:40 -04:00
Daniel Smith 9fc8a79e37 Revert "Revert "Don't take the proxy mutex in the traffic path"" 2015-09-01 16:40:11 -07:00
Daniel Smith 46ae7e87c7 Increase timeout to fix flaky tests 2015-09-01 16:08:13 -07:00
Daniel Smith a20d7ca481 Revert "Don't take the proxy mutex in the traffic path" 2015-09-01 13:33:05 -07:00
Tim Hockin f0a9badd2d Don't take the proxy mutex in the traffic path
This should make throughput better on the userspace proxier.

Fixes #11977
2015-08-31 17:01:52 -07:00
Abhishek Shah b6b8e99393 External IPs support. 2015-08-20 16:10:01 -07:00
jiangyaoguo 5a95eb7326 Test UDP timeout 2015-08-19 21:50:43 +08:00
Tim Hockin 776132e1ae Make kube-proxy iptables sync period configurable 2015-08-13 09:53:32 -07:00
Kris Rousey 565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -07:00
BenTheElder 6bbf2aaab7 Refactor pkg/proxy/config's ServiceConfigHandler and EndpointsConfigHandler to have different update methods.
Refactor `pkg/proxy/config`’s ServiceConfigHandler.OnUpdate and
EndpointsConfigHandler.OnUpdate to different method names as they have
different signatures.

This will let the new proxy
(https://github.com/GoogleCloudPlatform/kubernetes/issues/3760)
implement both interfaces.

Since we won’t need a separate loadbalancer structure (load balancing
is handled in the proxy rules), we will simply handle both event types
from the same object.
2015-08-08 15:16:55 -04:00
BenTheElder 1f6baa6549 Move userspace code to sub-package in proxy.
Moves the userspace code in proxy to a sub-package and adds the
ProxyProvider interface.

This is in preparation for landing an implementation of
https://github.com/GoogleCloudPlatform/kubernetes/issues/3760, which
will mostly be in another sub package for iptables.
2015-08-07 20:07:15 -04:00