Commit Graph

78 Commits (cf7225f56180a0e44922f59e870c4378f2f72d59)

Author SHA1 Message Date
Dan Williams cf7225f561 proxy/userspace: replace IsServiceIPSet() with ShouldSkipService()
Keeps things consistent with iptables/IPVS proxies. Proxies don't
handle ServiceTypeExternalName even if the ClusterIP is set.
2019-04-05 16:16:36 -05:00
Dan Williams 04b943ce38 proxy/userspace: track initial service/endpoints sync
We'll use this shortly to prevent premature syncing before all
initial endpoints and services have been received from the
apiserver.
2019-04-05 16:16:36 -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
Dan Williams 4b07f80d20 proxy: consolidate ServicesHandler/EndpointsHandler into ProxyProvider
Proxies should be able to cleanly figure out when endpoints have been synced,
so make all ProxyProviders also implement EndpointsHandler and pass those
through to loadbalancers when required.
2019-04-05 16:16:35 -05:00
Davanum Srinivas 954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
x00416946 fisherxu 79e17e6cd7 use versioned api in kube-proxy 2018-08-16 09:59:33 +08:00
tanshanshan 8608901e24 reuse iptablesContainerPortalArgs 2018-07-23 11:35:16 +08:00
Nicolas Bigler defdd80cbd
Fix duplicate comment in iptables rule for non-local public-port rule
When kubernetes creates an iptable rule for "from-non-local public-port"
rule the rule gets created with two identical comment section.

The function `iptablesNonLocalNodePortArgs` creates a list of arguments
for the rule from iptablesCommonPortalArgs function. This function
already appends the arguments for the rules comments and therefore does
not require appending the comment again.
2018-04-12 18:10:16 +02:00
hzxuzhonghu ab58014cc2 LoadBalancerStatus make use of generated deep copy method 2018-03-28 14:08:50 +08:00
Zihong Zheng 2ae45e9f1b [kube-proxy] Make the import name of utilproxy consistent 2018-02-27 11:14:02 -08:00
m1093782566 b498a33927 userspace part changes 2018-02-26 23:48:48 +08:00
Pavithra Ramesh 098a4467fe Remove conntrack entry on udp rule add.
Moved conntrack util outside of proxy pkg
Added warning message if conntrack binary is not found
Addressed review comments.
ran gofmt
2018-02-22 23:34:42 -08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Ma Shimiao 9cfdc8fbde add more ipv6 support in userspace proxier
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-11-13 17:00:52 +08:00
m1093782566 83ada5c7bf replace sets.List() with sets.UnsortedList() 2017-11-13 10:20:54 +08:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Kubernetes Submit Queue 1d8f1e268f Merge pull request #47699 from supereagle/fix-typos
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix typos: remove duplicated word in comments

**What this PR does / why we need it**: Remove the duplicated word `the` in comments

**Which issue this PR fixes** : fixes #

**Special notes for your reviewer**:

```release-note
NONE
```
2017-10-17 02:35:52 -07:00
Dane LeBlanc 6d71eb590b Add check for IPv6 '::' when calculating kube-proxy's node IP
kube-proxy currently checks for a bind address of 0.0.0.0 (IPv4 all-zeros)
when calculating kube-proxy's node IP, but it does not check for
an address of '::' (IPv6 all-zeros). For either of those all-zeros
addresses, the node IP should be determined based on the hostname,
rather than using the address directly.

Also added a helpful log message when the kube-proxy protocol is
determined to be IPv6.

fixes #52613
2017-09-25 17:54:57 -04:00
supereagle 87c29a08e1 fix typos: remove duplicated word in comments 2017-09-16 14:38:10 +08:00
m1093782566 1faa6f56b9 fix kube-proxy panic 2017-09-01 16:18:03 +08:00
m1093782566 c355a2ac96 Paramaterize stickyMaxAgeMinutes for service in API 2017-08-25 17:44:47 +08:00
m1093782566 992f618343 move IsLocalIP() and ShouldSkipService() to pkg/proxy/util 2017-08-17 14:32:05 +08:00
m1093782566 7b8372db99 move UDP conntrack operations together to pkg/proxy/util/conntrack.go 2017-08-12 11:10:04 +08:00
ymqytw 3dfc8bf7f3 update import 2017-07-20 11:03:49 -07:00
Dan Williams 8a58f62fe0 proxy/userspace: honor listen IP address as host IP if given
Allows the proxier to be used on an interface that's not the default route,
otherwise hostIP gets set to the default route interface even if that's
not what the user intended.

If listen IP isn't given, falls back to previous behavior.
2017-07-07 11:17:17 -05: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
Chao Xu d9920c53a5 move ref.go to its own subpackage 2017-04-13 10:02:43 -07:00
Chao Xu 08aa712a6c move helpers.go to helper 2017-04-11 15:49:11 -07: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
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
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
xiangpengzhao 513b346bb7 Log portal IP in error info. 2016-11-01 05:26:16 -04:00
Michal Rostecki 59ca5986dd Print/log pointers of structs with %#v instead of %+v
There are many places in k8s where %+v is used to format a pointer
to struct, which isn't working as expected.

Fixes #26591
2016-08-01 22:27:56 +02:00
Minhan Xia 51dcff40e6 Merge remote-tracking branch 'thockin/userspace-proxy-affinity-25314' into kubeproxyfix 2016-07-01 11:48:02 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Tim Hockin 9052eddaf6 Don't delete affinity when endpoints are empty
This only affects the userspace kube-proxy.
2016-05-07 21:23:50 -07:00
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
Tim Hockin 41ba8ced6d Dont log errors on proxy leftover cleanup 2016-02-07 02:41:50 +00:00
k8s-merge-robot 26202fc98a Merge pull request #18804 from marun/fix-nodeport-services
Auto commit by PR queue bot
2016-02-02 14:07:49 -08:00
Maru Newby a5e00da867 Fix nodeport service compat with default-deny fw 2016-02-01 21:34:30 +00:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
Harry Zhang 936a11e775 Use networking to hold network related pkgs
Change names of unclear methods

Use net as pkg name for short
2016-01-15 13:46:16 +08:00
Saad Ali 06113d3b87 Merge pull request #16137 from ArtfulCoder/externalIPFix
release NodePort correctly
2015-10-23 12:03:38 -07:00
Abhishek Shah 7c64802f48 release NodePort correctly 2015-10-22 16:36:52 -07:00
Abhishek Shah d172ca6986 Added UdpIdleTimeout flag 2015-10-21 17:25:35 -07:00