Commit Graph

24 Commits

Author SHA1 Message Date
Antonio Ojea
19f61caabe aggregate kube-proxy metrics
Instead of using two metrics use just one metrics with multiple labels,
since the labels can only get 2 values, 200 or 503 there is no risk of
carindality explosion and are simple to represent in graphs.

Change-Id: I0e9cbd6ec2051de44d277d673dc20f02b96aa4d1
2023-07-16 11:47:19 +00:00
Alexander Constantinescu
08dd657a71 Implement metrics agreed on the KEP 2023-07-10 10:32:02 +02:00
Alexander Constantinescu
9b1c4c7b57 Implement KEP-3836
TL;DR: we want to start failing the LB HC if a node is tainted with ToBeDeletedByClusterAutoscaler.
This field might need refinement, but currently is deemed our best way of understanding if
a node is about to get deleted. We want to do this only for eTP:Cluster services.

The goal is to connection draining terminating nodes
2023-07-10 10:30:54 +02:00
Cezary Zawadka
4e6aa5fb86 kube-proxy service health: add new return header with number of local endpoints
- add new header "X-Load-Balancing-Endpoint-Weight" returned from service health. Value of the header is number of local endpoints. Header can be used in weighted load balancing. Parsing header for number of endpoints is faster than unmarshalling json from the content body.

- add missing unit test for new and old headers returned from service health
2023-06-30 11:25:48 +02:00
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
Dan Winship
a744a186b6 Rename GetNodeAddresses to GetNodeIPs, return net.IP 2023-05-16 09:14:09 -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
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
Hao Ruan
c4e1b01416 replace spew methods with dump methods 2023-04-14 08:05:53 +08:00
Alexander Constantinescu
ec917850af Add proxy healthz result to ETP=local health check
Today, the health check response to the load balancers asking Kube-proxy for
the status of ETP:Local services does not include the healthz state of Kube-
proxy. This means that Kube-proxy might indicate to load balancers that they
should forward traffic to the node in question, simply because the endpoint
is running on the node - this overlooks the fact that Kube-proxy might be
not-healthy and hasn't successfully written the rules enabling traffic to
reach the endpoint.
2023-03-06 10:53:17 +01:00
Dan Winship
0c2711bf24 Make NodePortAddresses abstraction around GetNodeAddresses/ContainsIPv4Loopback 2023-02-22 08:32:19 -05:00
Quan Tian
a5790d5caa Do not log errors when ServiceHealthServer is closed normally
Server.Serve() always returns a non-nil error. If it exits because the
http server is closed, it will return ErrServerClosed. To differentiate
the error, this patch changes to close the http server instead of the
listener when the Service is deleted. Closing http server automatically
closes the listener, there is no need to cache the listeners any more.

Signed-off-by: Quan Tian <qtian@vmware.com>
2022-12-29 17:11:29 +08:00
wojtekt
d9b08c611d Migrate to k8s.io/utils/clock 2021-09-17 15:19:08 +02:00
Khaled (Kal) Henidak
784c31cca1 change health checkport to listen to node port addresses 2021-09-13 18:27:06 +00: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
Zihong Zheng
db379de778 Emit event and retry when fail to start healthz server on kube-proxy. 2017-07-27 20:54:51 -07:00
Clayton Coleman
3e095d12b4
Refactor move of client-go/util/clock to apimachinery 2017-05-20 14:19:48 -04:00
Zihong Zheng
eed08362d8 Add healthz server support to healthcheck package 2017-05-05 14:42:27 -07:00
Tim Hockin
0022639a2f Zero-out healthchecks when no endpoints 2017-04-10 21:43:33 -07:00
Tim Hockin
87d3f2c622 overhaul proxy healthchecks
The existing healthcheck lib was pretty complicated and was hiding some
bugs (like the count always being 1),  This is a reboot of the interface
and implementation to be significantly simpler and better tested.
2017-04-05 14:22:56 -07:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Girish Kalele
282880f549 Code review changes 2016-08-20 19:49:30 -07:00
Girish Kalele
29188c68d5 Load Balancer Health Check responder library for ESIPP 2016-08-20 19:45:56 -07:00