Commit Graph

1938 Commits

Author SHA1 Message Date
carlory
5e048041e4 remove helper function for unused storage feature in pkg/proxy/util 2023-06-13 09:22:59 +08:00
Kubernetes Prow Robot
b2042d6ce4
Merge pull request #118338 from aroradaman/mv-ipset
move pkg/util/ipset inside pkg/proxy/ipvs
2023-06-09 08:14:24 -07:00
Dan Winship
4962e6eacb Squash detectNodeIP and nodeIPTuple together 2023-06-06 20:48:00 -04:00
Daman Arora
4bee9b2b35 structured logging in proxy/ipvs/ipset
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-06-07 01:21:03 +05:30
Kubernetes Prow Robot
5a5ebfd88b
Merge pull request #118499 from aojea/kproxy_podcidr_alt
kube-proxy avoid race condition using LocalModeNodeCIDR
2023-06-06 12:18:11 -07:00
Antonio Ojea
26801d6541 kube-proxy avoid race condition using LocalModeNodeCIDR
Since kube-proxy in LocalModeNodeCIDR needs to obtain the PodCIDR
assigned to the node it watches for the Node object.

However, kube-proxy startup process requires to have these watches in
different places, that opens the possibility of having a race condition
if the same node is recreated and a different PodCIDR is assigned.

Initializing the second watch with the value obtained in the first one
allows us to detect this situation.

Change-Id: I6adeedb6914ad2afd3e0694dcab619c2a66135f8
Signed-off-by: Antonio Ojea <aojea@google.com>
2023-06-06 15:03:22 +00:00
TommyStarK
1fcfd1d509 pkg/util/iptables: use buf.String() instead of string(buf.Bytes())
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-06-05 19:47:47 +02:00
guoguangwu
fd92acba5a chore: should use buf.String() instead of string(buf.Bytes()) 2023-06-03 13:48:15 +08:00
Kubernetes Prow Robot
7d24586663
Merge pull request #118334 from danwinship/proxyutil
Consistently use proxyutil as the name for pkg/proxy/util
2023-05-30 12:49:46 -07:00
Daman Arora
2d8c820741 move pkg/util/ipset inside pkg/proxy/ipvs
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-05-31 00:30:20 +05:30
Dan Winship
f3ba935336 Consistently use proxyutil as the name for pkg/proxy/util
Some places were using utilproxy, but that implies that it's
pkg/util/proxy...
2023-05-30 12:18:49 -04:00
Lars Ekman
4aa5441de2 Move pkg/util/ipvs inside pkg/proxy/ipvs
Ipvs will never be used by any other component within K8s than
the proxy/ipvs

Signed-off-by: Lars Ekman <uablrek@gmail.com>
2023-05-27 18:37:50 +02:00
Daman Arora
c68f858658 proxy/ipvs: github user name change: daman1807 -> aroradaman
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-05-24 16:00:20 +05:30
Kubernetes Prow Robot
b2a1855f2c
Merge pull request #118088 from danwinship/kube-proxy-belated-cleanup
belated cleanup of some kube-proxy stuff for old versions
2023-05-18 13:18:34 -07:00
Dan Winship
80b9c85361 belated cleanup of some kube-proxy stuff for old versions 2023-05-17 18:34:27 -04:00
Dan Winship
0e456dcf86 Clarify localhost nodeport comments/errors 2023-05-16 09:14:11 -04:00
Dan Winship
a744a186b6 Rename GetNodeAddresses to GetNodeIPs, return net.IP 2023-05-16 09:14:09 -04:00
Dan Winship
2ca215fd99 Add NodePortAddresses.MatchAll()
Rather than having GetNodeAddresses() return a special magic value
indicating that it matches all IPs, add a separate method to check
that. (And have GetNodeAddresses() just return the IPs as expected
instead.)
2023-05-16 09:09:24 -04:00
Dan Winship
9ac657bb94 Make NodePortAddresses explicitly IP-family-specific
Both proxies handle IPv4 and IPv6 nodeport addresses separately, but
GetNodeAddresses went out of its way to make that difficult. Fix that.

This commit does not change any externally-visible semantics, but it
makes the existing weird semantics more obvious. Specifically, if you
say "--nodeport-addresses 10.0.0.0/8,192.168.0.0/16", then the
dual-stack proxy code would have split that into a list of IPv4 CIDRs
(["10.0.0.0/8", "192.168.0.0/16"]) to pass to the IPv4 proxier, and a
list of IPv6 CIDRs ([]) to pass to the IPv6 proxier, and then the IPv6
proxier would say "well since the list of nodeport addresses is empty,
I'll listen on all IPv6 addresses", which probably isn't what you
meant, but that's what it did.
2023-05-15 10:53:44 -04:00
Dan Winship
f7bb9a9a0a Remove a mostly-unused variable in the ipvs proxy
It probably was used for something else in the past but it's pointless
now.
2023-05-15 10:53:21 -04:00
Daman Arora
a0133b7cc4 proxy/ipvs: added daman1807 as reviewer
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-05-14 16:29:43 +05:30
Kubernetes Prow Robot
fda4ca0d8a
Merge pull request #117965 from daman1807/fix/ipvs-ipv6-healthcheck
proxy/ipvs: use healthzServer for instantiating the IPVS IPv6 proxier
2023-05-13 12:29:37 -07:00
Kubernetes Prow Robot
8479db5876
Merge pull request #117946 from lavalamp/lavalamp-taking-a-break
lavalamp is taking a long break
2023-05-12 14:34:47 -07:00
Daman Arora
3dc4eea889 proxy/service_health: release read lock early
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-05-12 15:04:04 +05:30
Daman Arora
808098c4c6 proxy/ipvs: healthzServer for instantiating the proxier
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2023-05-12 12:57:47 +05:30
Daniel Smith
1ffe3f467e lavalamp is taking a long break 2023-05-11 16:43:38 +00:00
Dan Winship
c3971002c9 MinimizeIPTablesRestore to GA 2023-05-09 18:19:00 -04:00
Dan Winship
cd51c1803e Add new partial/full sync time metrics for iptables kube-proxy 2023-05-05 22:48:45 -04:00
Daman
6a5cf99aad pkg/proxy: human-readable messages
Signed-off-by: Daman <aroradaman@gmail.com>
2023-05-05 14:29:24 +05:30
Daman
c2c8b8d178 pkg/proxy: using generic sets
pkg/proxy: using generic sets

Signed-off-by: Daman <aroradaman@gmail.com>
2023-05-05 14:29:23 +05:30
Kubernetes Prow Robot
ff244415ae
Merge pull request #117747 from danwinship/proxy-startup-config
proxy startup-time config handling cleanup (take 2)
2023-05-04 14:37:24 -07:00
Antonio Ojea
791573ddb6 promote ProxyTerminatingEndpoints to GA
Change-Id: Ife524c831d905acbc606aa7631e1194f91199938
2023-05-04 12:58:33 +00:00
Dan Winship
10a869fc75 Remove duplicated config fields from ProxyServer
Rather than duplicating some of the KubeProxyConfiguration into
ProxyServer, just store the KubeProxyConfiguration itself so later
code can reference it directly.

For the fields that get platform-specific defaults (Mode,
DetectLocalMode), fill the defaults directly into the
KubeProxyConfiguration rather than keeping the original there and the
defaulted version in the ProxyServer.
2023-05-03 10:15:37 -04:00
Dan Winship
c4575c3438 Fix up detect-local-mode validation
Validate the --detect-local-mode value in the API object validation
rather than doing it separately later. Also, remove runtime checks and
unit tests for cases that would be blocked by validation
2023-05-03 08:22:49 -04:00
Kubernetes Prow Robot
c76efa64ee
Merge pull request #117723 from Nordix/healthcheck-via-lbadr
Kube-proxy/ipvs: accept access to healthCheckNodePort on LbIP
2023-05-02 12:44:22 -07:00
Kubernetes Prow Robot
2e78e07ee5
Merge pull request #117716 from thockin/validation_test_whitespace
Clean up brace whitespace in **/validation_test.go
2023-05-02 10:02:25 -07:00
Lars Ekman
e496085bd3 Kube-proxy/ipvs: accept access to healthCheckNodePort on LbIP 2023-05-02 15:51:22 +02:00
Tim Hockin
d55b67b349
Clean up brace whitespace in **/validation_test.go
This was making my eyes bleed as I read over code.

I used the following in vim.  I made them up on the fly, but they seemed
to pass manual inspection.

:g/},\n\s*{$/s//}, {/
:w
:g/{$\n\s*{$/s//{{/
:w
:g/^\(\s*\)},\n\1},$/s//}},/
:w
:g/^\(\s*\)},$\n\1}$/s//}}/
:w
2023-05-02 00:48:42 -07:00
Stephen Kitt
1c4b97ea27
network: replace intstr.FromInt with intstr.FromInt32
This touches cases where FromInt() is used on numeric constants, or
values which are already int32s, or int variables which are defined
close by and can be changed to int32s with little impact.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-05-01 09:17:30 +02:00
Paco Xu
e28f3de656
Revert "proxy startup-time config handling cleanup" 2023-04-30 09:05:42 +08:00
Kubernetes Prow Robot
e8130ba572
Merge pull request #117297 from danwinship/proxy-startup-config
proxy startup-time config handling cleanup
2023-04-28 17:32:16 -07:00
Dan Winship
258c4c4251 Remove duplicated config fields from ProxyServer
Rather than duplicating some of the KubeProxyConfiguration into
ProxyServer, just store the KubeProxyConfiguration itself so later
code can reference it directly.

For the fields that get platform-specific defaults (Mode,
DetectLocalMode), fill the defaults directly into the
KubeProxyConfiguration rather than keeping the original there and the
defaulted version in the ProxyServer.
2023-04-27 15:43:35 -04:00
Dan Winship
9d4f10f5d2 Fix up detect-local-mode validation
Validate the --detect-local-mode value in the API object validation
rather than doing it separately later. Also, remove runtime checks and
unit tests for cases that would be blocked by validation
2023-04-27 15:43:35 -04:00
Lars Ekman
5ece6541b8 proxy/ipvs: don't bind nodeips to the dummy device 2023-04-27 21:02:25 +02:00
Lars Ekman
5310305098 proxy/ipvs: add a GetAllLocalAddressesExcept() function 2023-04-27 21:02:20 +02:00
Daman
a6339e2702 proxy/conntrack: using common conntrack cleaning function in proxiers 2023-04-16 15:59:14 +05:30
Daman
399f09dde0 proxy/conntrack: common function for cleaning stale conntrack entries 2023-04-16 15:54:47 +05:30
Daman
efb0563094 proxy/conntrack: moved pkg/util/conntrack -> pkg/proxy/conntrack 2023-04-16 15:52:52 +05:30
Kubernetes Prow Robot
d060d487dc
Merge pull request #117278 from haoruan/cleanup/replace-spew-with-dump
replace spew methods with dump methods
2023-04-13 19:54:39 -07:00
Hao Ruan
c4e1b01416 replace spew methods with dump methods 2023-04-14 08:05:53 +08:00