Commit Graph

222 Commits

Author SHA1 Message Date
Lars Ekman
aa8521df66 Issue #70020; Flush Conntrack entities for SCTP
Signed-off-by: Lars Ekman <lars.g.ekman@est.tech>
2020-03-11 09:56:54 +01:00
Satyadeep Musuvathy
8c6956e5bb Refactor handling of local traffic detection. 2020-02-21 17:57:34 -08:00
Kubernetes Prow Robot
ad68c4a8b5
Merge pull request #87699 from michaelbeaumont/fix_66766
kube-proxy: Only open ipv4 sockets for ipv4 clusters
2020-02-13 23:54:18 -08:00
Andrew Sy Kim
1653476e3f proxier: use IPSet from k8s.io/utils/net to store local addresses
This allows the proxier to cache local addresses instead of fetching all
local addresses every time in IsLocalIP.

Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2020-02-11 16:44:34 -05:00
Andrew Sy Kim
126bf5a231 ipvs proxier: use util proxy methods for getting local addresses
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2020-02-11 16:35:49 -05:00
Michael Beaumont
3eea0d1405
kube-proxy: Only open ipv4 sockets for ipv4 clusters 2020-01-30 18:54:16 +01:00
Rob Scott
47b2593d59
Creating new EndpointSliceProxying feature gate for kube-proxy
This creates a new EndpointSliceProxying feature gate to cover EndpointSlice
consumption (kube-proxy) and allow the existing EndpointSlice feature gate to
focus on EndpointSlice production only. Along with that addition, this enables
the EndpointSlice feature gate by default, now only affecting the controller.

The rationale here is that it's really difficult to guarantee all EndpointSlices
are created in a cluster upgrade process before kube-proxy attempts to consume
them. Although masters are generally upgraded before nodes, and in most cases,
the controller would have enough time to create EndpointSlices before a new node
with kube-proxy spun up, there are plenty of edge cases where that might not be
the case. The primary limitation on EndpointSlice creation is the API rate limit
of 20QPS. In clusters with a lot of endpoints and/or with a lot of other API
requests, it could be difficult to create all the EndpointSlices before a new
node with kube-proxy targeting EndpointSlices spun up.

Separating this into 2 feature gates allows for a more gradual rollout with the
EndpointSlice controller being enabled by default in 1.18, and EndpointSlices
for kube-proxy being enabled by default in the next release.
2020-01-17 16:17:40 -08:00
Kubernetes Prow Robot
6278df2a97
Merge pull request #82223 from rikatz/issue77493
Check first if ipvs module is builtin
2020-01-17 03:52:56 -08:00
danielqsj
a8f2feaeb5 remove deprecated metrics of proxy 2020-01-10 17:05:38 +08:00
Kubernetes Prow Robot
5373fa3f59
Merge pull request #82462 from vllry/dualstack-iptables
Dualstack support for kube-proxy iptables mode
2020-01-07 04:38:20 -08:00
Andrew Sy Kim
db2c048db9 support configuration of kube-proxy IPVS tcp,tcpfin,udp timeout
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-12-17 04:35:08 -05:00
Vallery Lancey
23957a6b28 Allow kube-proxy iptables mode to support dual-stack, with the meta-proxier. 2019-12-16 22:50:25 -08:00
Andrew Sy Kim
884582d892 proxier: improve node topology event handler logic
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-11-15 08:53:56 -05:00
Roc Chan
80c6524cd0 kube-proxy: sync rules when current node labels change detected 2019-11-15 13:36:43 +08:00
Roc Chan
c9cf3f5b72 Service Topology implementation
* Implement Service Topology for ipvs and iptables proxier
* Add test files
* API validation
2019-11-15 13:36:43 +08:00
Rob Scott
a7e589a8c6
Promoting EndpointSlices to beta 2019-11-13 14:20:19 -08:00
Gao Zheng
6b36a60c75 kube-proxy/ipvs get local addr just once per sync 2019-11-12 19:40:21 +08:00
zouyee
a3e0ac2951 set config.BindAddress to IPv4 address "127.0.0.1" if not specified
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2019-10-25 21:46:41 +08:00
Ricardo Pchevuzinske Katz
6aaae7d646 Add support for builtin modules in kube-proxy
Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@serpro.gov.br>
2019-10-23 13:59:44 -03:00
Kubernetes Prow Robot
a7b3114c88
Merge pull request #83553 from rikatz/issue77493-part1
Improve IPVS Module loader logic
2019-10-15 23:05:13 -07:00
Ricardo Pchevuzinske Katz
da8931560b Improve IPVS Module loader logic
Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@serpro.gov.br>
2019-10-11 08:59:41 -03:00
Dan Winship
f83474916e Fix kube-proxy healthz server for proxier sync loop changes
The proxy healthz server assumed that kube-proxy would regularly call
UpdateTimestamp() even when nothing changed, but that's no longer
true. Fix it to only report unhealthiness when updates have been
received from the apiserver but not promptly pushed out to
iptables/ipvs.
2019-10-04 13:37:09 -04:00
Dan Winship
0f10102c16 Better distinguish the two kinds of proxy health check servers
Kube-proxy runs two different health servers; one for monitoring the
health of kube-proxy itself, and one for monitoring the health of
specific services. Rename them to "ProxierHealthServer" and
"ServiceHealthServer" to make this clearer, and do a bit of API
cleanup too.
2019-10-04 10:37:58 -04:00
Kubernetes Prow Robot
61ecdba9ca
Merge pull request #82289 from robscott/endpointslice-fixes
Fixing bugs related to Endpoint Slices
2019-09-05 09:03:10 -07:00
Rob Scott
8f9483d827
Fixing bugs related to Endpoint Slices
This should fix a bug that could break masters when the EndpointSlice
feature gate was enabled. This was all tied to how the apiserver creates
and manages it's own services and endpoints (or in this case endpoint
slices). Consumers of endpoint slices also need to know about the
corresponding service. Previously we were trying to set an owner
reference here for this purpose, but that came with potential downsides
and increased complexity. This commit changes behavior of the apiserver
endpointslice integration to set the service name label instead of owner
references, and simplifies consumer logic to reference that (both are
set by the EndpointSlice controller).

Additionally, this should fix a bug with the EndpointSlice GenerateName
value that had previously been set with a "." as a suffix.
2019-09-04 09:09:32 -07:00
Kubernetes Prow Robot
f71cfdf66d
Merge pull request #82214 from Nordix/issue-80462
Ensure the KUBE-MARK-DROP chain in kube-proxy mode=ipvs
2019-09-03 16:01:37 -07:00
Kubernetes Prow Robot
542f3c65a0
Merge pull request #78547 from MikeSpreitzer/fix-76699
Make iptables and ipvs modes of kube-proxy MASQUERADE --random-fully if possible
2019-09-03 14:34:58 -07:00
Lars Ekman
9e6a687352 Ensure the KUBE-MARK-DROP chain in kube-proxy mode=ipvs 2019-09-03 21:08:54 +02:00
Mike Spreitzer
d86d1defa1 Made IPVS and iptables modes of kube-proxy fully randomize masquerading if possible
Work around Linux kernel bug that sometimes causes multiple flows to
get mapped to the same IP:PORT and consequently some suffer packet
drops.

Also made the same update in kubelet.

Also added cross-pointers between the two bodies of code, in comments.

Some day we should eliminate the duplicate code.  But today is not
that day.
2019-09-01 22:07:30 -04:00
Khaled Henidak(Kal)
465255425e create meta-proxy for proxy-mode=ipvs (dualstack)
co-authored-by: Lars Ekman <lars.g.ekman@est.tech>
2019-08-29 23:37:37 +00:00
Kubernetes Prow Robot
4495d09282
Merge pull request #81430 from robscott/endpointslice-proxy
Adding EndpointSlice support for kube-proxy ipvs and iptables proxiers
2019-08-29 15:36:44 -07:00
Rob Scott
9665c590c7
Adding EndpointSlice support for kube-proxy ipvs and iptables proxiers 2019-08-29 01:06:52 -07:00
Kubernetes Prow Robot
454e8e6e92
Merge pull request #80514 from liuxu623/master
don't delete KUBE-MARK-MASQ chain in iptables/ipvs proxier
2019-08-28 23:49:56 -07:00
Kubernetes Prow Robot
bd8a8db515
Merge pull request #81477 from paulsubrata55/kube-proxy-sctp-ipset-fix
Fix in kube-proxy for sctp ipset entries
2019-08-28 18:26:09 -07:00
Kubernetes Prow Robot
0a486d97ed
Merge pull request #81415 from oxddr/asdf
kube-proxy: improve logging around network programming latency SLI.
2019-08-23 15:48:39 -07:00
Janek Łukaszewicz
c33be173bf kube-proxy: improve logging around network programming latency SLI. 2019-08-23 15:48:25 +02:00
Kubernetes Prow Robot
9c736445f5
Merge pull request #79846 from aramase/fix-golint-pkg/proxy
Fix golint failures in pkg/proxy
2019-08-23 00:51:17 -07:00
liuxu
c90b295ef1 don't delete KUBE-MARK-MASQ chain in iptables/ipvs proxier 2019-08-20 15:43:54 +08:00
Subrata Paul
138b8b8aaa Fix in kube-proxy for sctp ipset entries
Kube-proxy will add ipset entries for all node ips for an SCTP nodeport service. This will solve the problem 'SCTP nodeport service is not working for all IPs present in the node when ipvs is enabled. It is working only for node's InternalIP.'
2019-08-18 00:40:27 +05:30
Kubernetes Prow Robot
d21822a02a
Merge pull request #81538 from thockin/master
Don't track syncProxyRules runtime if not running
2019-08-17 09:24:06 -07:00
Tim Hockin
5b14394f4e Don't track syncProxyRules runtime if not running 2019-08-16 17:05:03 -07:00
Kubernetes Prow Robot
12a085f917
Merge pull request #80942 from gongguan/fix_ipvs_svc_del
fix ipvs_svc deletion
2019-08-13 02:27:54 -07:00
ethan
94efd3fcdf
cleanup: proxier.go error message fix 2019-08-12 22:36:16 +08:00
louisssgong
97c4edaa4f Fix a bug in the IPVS proxier where virtual servers are not cleaned up even though the corresponding Service object was deleted. 2019-08-10 06:32:38 +08:00
hui luo
a2ef00c1b1 Add iptables restore failure metrics
As mentioned in issue #80061, in iptables lock contention case,
we can see increasing rate of iptables restore failures because it
need to grab iptables file lock.

The failure metric can provide administrators more insight

Metrics will be collected in kube-proxy iptables and ipvs modes

Signed-off-by: Hui Luo <luoh@vmware.com>
2019-08-09 10:18:19 -07:00
Emrecan BATI
90ce2d50d3 Add GetKernelVersion to ipvs.KernelHandler interface
ipvs `getProxyMode` test fails on mac as `utilipvs.GetRequiredIPVSMods`
try to reach `/proc/sys/kernel/osrelease` to find version of the running
linux kernel. Linux kernel version is used to determine the list of required
kernel modules for ipvs.

Logic to determine kernel version is moved to GetKernelVersion
method in LinuxKernelHandler which implements ipvs.KernelHandler.
Mock KernelHandler is used in the test cases.

Read and parse file is converted to go function instead of execing cut.
2019-07-31 22:10:44 +03:00
silenceshell
c31a2b7076
kube-proxy in ipvs mode use ipvs to redirect traffic
fix the comment.
2019-07-28 21:36:02 +08:00
Cezar Sa Espinola
c25763e159
proxy/ipvs: Compute all node ips only once when a zero cidr is used
Computing all node ips twice would always happen when no node port
addresses were explicitly set. The GetNodeAddresses call would return
two zero cidrs (ipv4 and ipv6) and we would then retrieve all node IPs
twice because the loop wouldn't break after the first time.

Also, it is possible for the user to set explicit node port addresses
including both a zero and a non-zero cidr, but this wouldn't make sense
for nodeIPs since the zero cidr would already cause nodeIPs to include
all IPs on the node.
2019-07-23 13:35:37 -03:00
Cezar Sa Espinola
5c16940508
proxy/ipvs: Only compute node ip addresses once per sync
Previously the same ip addresses would be computed for each nodePort
service and this could be CPU intensive for a large number of nodePort
services with a large number of ipaddresses on the node.
2019-07-23 13:35:27 -03:00
Anish Ramasekar
2878270f5b
Fix golint failures in pkg/proxy
Review feedback - remove alias from imports

fix comments
2019-07-08 11:48:33 -07:00