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
This commit is contained in:
Alexander Constantinescu
2022-07-15 01:21:39 +02:00
parent 0ae9aaacfa
commit 9b1c4c7b57
7 changed files with 200 additions and 11 deletions

View File

@@ -27,6 +27,7 @@ import (
"strings"
"time"
"k8s.io/kubernetes/pkg/features"
utilnode "k8s.io/kubernetes/pkg/util/node"
"github.com/fsnotify/fsnotify"
@@ -869,6 +870,11 @@ func (s *ProxyServer) Run() error {
if s.Config.DetectLocalMode == kubeproxyconfig.LocalModeNodeCIDR {
nodeConfig.RegisterEventHandler(proxy.NewNodePodCIDRHandler(s.podCIDRs))
}
if utilfeature.DefaultFeatureGate.Enabled(features.KubeProxyDrainingTerminatingNodes) {
nodeConfig.RegisterEventHandler(&proxy.NodeEligibleHandler{
HealthServer: s.HealthzServer,
})
}
nodeConfig.RegisterEventHandler(s.Proxier)
go nodeConfig.Run(wait.NeverStop)