kube-proxy: update internal endpoints map with 'serving' and 'terminating' condition from EndpointSlice

Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
This commit is contained in:
Andrew Sy Kim
2020-11-09 10:24:43 -05:00
parent 65bdc9efe6
commit 55cb453a3c
7 changed files with 544 additions and 412 deletions

View File

@@ -97,6 +97,20 @@ type Endpoint interface {
String() string
// GetIsLocal returns true if the endpoint is running in same host as kube-proxy, otherwise returns false.
GetIsLocal() bool
// IsReady returns true if an endpoint is ready and not terminating.
// This is only set when watching EndpointSlices. If using Endpoints, this is always
// true since only ready endpoints are read from Endpoints.
IsReady() bool
// IsServing returns true if an endpoint is ready. It does not account
// for terminating state.
// This is only set when watching EndpointSlices. If using Endpoints, this is always
// true since only ready endpoints are read from Endpoints.
IsServing() bool
// IsTerminating retruns true if an endpoint is terminating. For pods,
// that is any pod with a deletion timestamp.
// This is only set when watching EndpointSlices. If using Endpoints, this is always
// false since terminating endpoints are always excluded from Endpoints.
IsTerminating() bool
// GetTopology returns the topology information of the endpoint.
GetTopology() map[string]string
// IP returns IP part of the endpoint.