Commit Graph

2214 Commits

Author SHA1 Message Date
Paco Xu
0e10a3a28c Revert "re: kube-proxy: internal config: refactor HealthzAddress and MetricsAddress " 2024-10-21 11:36:59 +08:00
Kubernetes Prow Robot
4d32d7e5ad Merge pull request #127930 from aroradaman/kube-proxy-refactor-healthz-metrics-address
re: kube-proxy: internal config: refactor HealthzAddress and MetricsAddress
2024-10-17 16:03:11 +01:00
Kubernetes Prow Robot
429edc5f25 Merge pull request #128060 from antoninbas/fix-typos-in-pkg/proxy/ipvs/ipset/ipset_test.go
Fix typos in pkg/proxy/ipvs/ipset/ipset_test.go
2024-10-14 22:02:21 +01:00
Antonin Bas
0350e5ae69 Fix typos in pkg/proxy/ipvs/ipset/ipset_test.go
There were a couple of typos in test error logs

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
2024-10-14 11:06:36 -07:00
Prince Pereira
3448455083 Replacing hcsshim library with new hnslib library. 2024-10-14 10:44:30 -07:00
Daman Arora
e63260082a kube-proxy: internal config: refactor Healthz and Metrics Address
Refactor Healthz with Metrics Address for internal configuration of
kube-proxy adhering to the v1alpha2 version specifications as detailed
in https://kep.k8s.io/784.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-10-14 22:56:23 +05:30
Daman Arora
48f1356b2f pkg/proxy: refactor NodePortAddresses to NodeAddressHandler
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-10-14 21:49:29 +05:30
Daman Arora
4f732a233d pkg/proxy/utils: file rename
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-10-14 21:31:39 +05:30
Aohan Yang
da5738d9aa Set feature gate emulation version during test 2024-10-10 19:26:31 +08:00
Daman Arora
7ce36f9bca kube-proxy: use netutils.MultiListen for healthz and metrics server
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-10-08 17:48:11 +05:30
Antonio Ojea
7c4c7b14b2 Revert "kube-proxy: internal config: refactor HealthzAddress and MetricsAddress " 2024-10-02 15:08:35 +02:00
Kubernetes Prow Robot
8539497010 Merge pull request #127780 from danwinship/deleted-udp-endpoints-fix
Fix deleted UDP endpoint detection
2024-10-01 22:06:02 +01:00
Kubernetes Prow Robot
98657377dc Merge pull request #126889 from aroradaman/kube-proxy-refactor-healthz-metrics-address
kube-proxy: internal config: refactor HealthzAddress and MetricsAddress
2024-10-01 14:45:49 +01:00
Dan Winship
65de5de81f Fix deleted UDP endpoint detection 2024-09-30 14:17:51 -04:00
Kubernetes Prow Robot
909f9b912e Merge pull request #127692 from mmorel-35/testifylint/expected-actual@k8s.io/kubernetes
fix: enable expected-actual rule from testifylint in module `k8s.io/kubernetes`
2024-09-28 05:54:01 +01:00
Matthieu MOREL
f736cca0e5 fix: enable expected-actual rule from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-27 07:56:31 +02:00
Matthieu MOREL
b7248077a9 fix: enable formatter rule from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-26 08:19:54 +02:00
Matthieu MOREL
27b98be303 fix: enable nil-compare and error-nil rules from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-25 06:02:47 +02:00
Daman Arora
3fe9ecd5af kube-proxy: internal config: refactor Healthz and Metrics Address
Refactor Healthz with Metrics Address for internal configuration of
kube-proxy adhering to the v1alpha2 version specifications as detailed
in https://kep.k8s.io/784.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-09-23 23:16:30 +05:30
Daman Arora
a3ad527ffd pkg/proxy: refactor npa.GetNodeIPs
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-09-23 23:04:42 +05:30
Daman Arora
11c0683c32 kube-proxy: use netutils.MultiListen for healthz and metrics server
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-09-23 23:03:26 +05:30
Kubernetes Prow Robot
b83ec12c43 Merge pull request #126847 from aroradaman/conntrack-netlink
Remove conntrack binary dependency from kube-proxy
2024-09-05 07:03:51 +01:00
Daman Arora
c34b20fa63 proxy/conntrack: use proxier ip family for conntrack cleanup
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-09-04 22:56:03 +05:30
Daman Arora
a6b4aa7005 proxy/conntrack: consolidate flow cleanup
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-09-04 21:55:22 +05:30
Daman Arora
b0f823e6cc remove the conntrack binary dependency
kube-proxy needs to delete stale conntrack entries for UDP services to
avoid blackholing traffic. Instead of using the conntrack binary it
can use netlink calls directly, reducing the containers images size and
the security surface.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
Co-authored-by: Antonio Ojea <aojea@google.com>
2024-09-04 21:48:34 +05:30
Joe Betz
2595aa1309 generate 2024-09-03 14:26:26 -04:00
Daman Arora
6c5dac89bc proxy/metrics: refactor nfacct metrics
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-08-27 23:15:03 +05:30
Kubernetes Prow Robot
201bdaa2fe Merge pull request #126532 from wedaly/kube-proxy-initial-sync-race
kube-proxy: initialization wait for service and endpoint handlers synced
2024-08-14 04:23:29 -07:00
Will Daly
d59687c367 kube-proxy: initialization wait for node and serviceCIDR synced
Follow-on from https://github.com/kubernetes/kubernetes/pull/126532
to wait for pre-sync events delivered for the remaining two informers
in kube-proxy (node and serviceCIDR).
2024-08-06 09:01:42 -07:00
Will Daly
5bd6cbba33 kube-proxy: initialization wait for service and endpoint handlers synced
Ensure kube-proxy waits for the services/endpointslices informer
caches to be synced *and* all pre-sync events delivered before
setting isInitialized=true. Otherwise, in clusters with many services,
some services may be missing from svcPortMap when kube-proxy starts
(e.g. during daemonset rollout). This can cause kube-proxy to temporarily
remove service DNAT rules and then skip cleanup of UDP conntrack entries
to a service VIP.

Resolves: https://github.com/kubernetes/kubernetes/issues/126468
2024-08-03 13:01:29 -07:00
Davanum Srinivas
4fc6d8daf5 [kube-proxy] add log verbosity to endpoint topology hint loop - Take 2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-08-02 22:28:51 -04:00
Dr. Stefan Schimanski
c7a1fa432a Call non-blocking informerFactory.Start synchronously to avoid races
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-07-27 18:13:09 +02:00
Daman Arora
5359098c14 kube-proxy: internal config: fuzz cidr values for unit tests
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-25 19:20:24 +05:30
Kubernetes Prow Robot
6834a1ef3d Merge pull request #126293 from aroradaman/kube-proxy-refactor-internal-config
Kube proxy refactor internal config
2024-07-23 11:02:46 -07:00
Nadia Pinaeva
2ec3929134 [kube-proxy:nftables] Add partial sync unit test.
Signed-off-by: Nadia Pinaeva <n.m.pinaeva@gmail.com>
2024-07-23 17:32:30 +02:00
Nadia Pinaeva
3ccf5b8a55 [kube-proxy:nftables] Add partialSync mode to only transact changed
objects.
Change the order of operations to stop current iteration if no changes
to the service chains are needed.
Bump syncProxy frequency to 1 hour.
In a test kind cluster creation of 10K services, 2 endpoints each,
takes ~25m before the fix and ~9min after. Maximum memory usage
during creation is ~650MiB and 260MiB respectively.
Another important metric is the time it takes to create 1 new service
when 10K svc already exist. It used to take ~8m before the fix,
with partialSync it takes ~141ms.

Signed-off-by: Nadia Pinaeva <n.m.pinaeva@gmail.com>
2024-07-23 17:32:30 +02:00
Nadia Pinaeva
dc13e42f56 [kube-proxy:nftables] cleanup: remove unused parameter and fix typo.
Signed-off-by: Nadia Pinaeva <n.m.pinaeva@gmail.com>
2024-07-23 17:32:29 +02:00
Daman Arora
3d589bd18a kube-proxy: internal config: remove PortRange
Remove PortRange for internal configuration of kube-proxy
adhering to the v1alpha2 version specifications as detailed in
https://kep.k8s.io/784.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-23 19:56:23 +05:30
Daman Arora
c57e1156f5 kube-proxy: internal config: refactor ClusterCIDR
Refactor ClusterCIDR for internal configuration of kube-proxy
adhering to the v1alpha2 version specifications as detailed in
https://kep.k8s.io/784.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-23 19:45:29 +05:30
Daman Arora
380adb93cc kube-proxy: internal config: consolidate SyncPeriod and MinSyncPeriod
Consolidate SyncPeriod and MinSyncPeriod for internal configuration
of kube-proxy adhering to the v1alpha2 version specifications as
detailed in https://kep.k8s.io/784.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-23 19:34:40 +05:30
Dan Winship
30bc1b59d7 Add unit tests to validate "bad IP/CIDR" handling in kube-proxy
Also, fix the handling of bad EndpointSlice IPs!
2024-07-18 10:55:13 -04:00
Dan Winship
f762e5c8de Remove an unnecessary comment in nftables output
(It's redundant with the chain name.)
2024-07-18 10:54:30 -04:00
Dan Winship
11f55eae96 Reduce some duplication in nftables unit tests 2024-07-18 10:53:36 -04:00
Daman Arora
6c10c97c3c kube-proxy: internal config: add Linux section
Introduce Linux section for internal configuration of kube-proxy
adhering to the v1alpha2 version specifications as detailed in
https://kep.k8s.io/784.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-16 19:20:48 +05:30
Daman Arora
7a6fec3ea7 kube-proxy: internal config: add Windows section
Introduce Windows section for internal configuration of kube-proxy
adhering to the v1alpha2 version specifications as detailed in
https://kep.k8s.io/784. This also introduces WindowsRunAsService
to v1alpha1 configuration.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-15 22:43:47 +05:30
Kubernetes Prow Robot
2d4514e169 Merge pull request #125802 from mmorel-35/testifylint/len+empty
fix: enable empty and len rules from testifylint on pkg and staging package
2024-07-11 23:12:06 -07:00
Kubernetes Prow Robot
1740d85aff Merge pull request #125866 from aroradaman/can-use-nfacct
nfacct: conditionally ensure counters and register metrics
2024-07-10 19:26:36 -07:00
Daman Arora
33bac685a7 conditionally register nfacct metrics and ensure nfacct counters
If the nfacct sub-system is not available in the kernel then:
1. nfacct based metrics won't be registered.
2. proxier will not attempt to ensure the counters

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-09 18:49:01 +05:30
Daman Arora
75b18b86dd proxy/utils/nfacct: API to check if nfacct sub-system is present
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-09 18:44:04 +05:30
Kubernetes Prow Robot
db91d45d2d Merge pull request #124152 from danwinship/knftables-versions
update client/kernel version requirements for nftables kube-proxy
2024-07-08 12:45:02 -07:00