mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-21 18:11:22 +00:00
pkg/proxy: update CategorizeEndpoints to apply ProxyTerminatingEndpoints to all traffic policies
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
This commit is contained in:
@@ -52,6 +52,19 @@ func CategorizeEndpoints(endpoints []Endpoint, svcInfo ServicePort, nodeLabels m
|
||||
return true
|
||||
})
|
||||
|
||||
// if there are 0 cluster-wide endpoints, we can try to fallback to any terminating endpoints that are ready.
|
||||
// When falling back to terminating endpoints, we do NOT consider topology aware routing since this is a best
|
||||
// effort attempt to avoid dropping connections.
|
||||
if len(clusterEndpoints) == 0 && utilfeature.DefaultFeatureGate.Enabled(features.ProxyTerminatingEndpoints) {
|
||||
clusterEndpoints = filterEndpoints(endpoints, func(ep Endpoint) bool {
|
||||
if ep.IsServing() && ep.IsTerminating() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
// If there are any Ready endpoints anywhere in the cluster, we are
|
||||
// guaranteed to get one in clusterEndpoints.
|
||||
if len(clusterEndpoints) > 0 {
|
||||
|
Reference in New Issue
Block a user