mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
Drop broken/no-op proxyconfig.EndpointsHandler implementations
Because the proxy.Provider interface included proxyconfig.EndpointsHandler, all the backends needed to implement its methods. But iptables, ipvs, and winkernel implemented them as no-ops, and metaproxier had an implementation that wouldn't actually work (because it couldn't handle Services with no active Endpoints). Since Endpoints processing in kube-proxy is deprecated (and can't be re-enabled unless you're using a backend that doesn't support EndpointSlice), remove proxyconfig.EndpointsHandler from the definition of proxy.Provider and drop all the useless implementations.
This commit is contained in:
@@ -751,14 +751,14 @@ func (s *ProxyServer) Run() error {
|
||||
serviceConfig.RegisterEventHandler(s.Proxier)
|
||||
go serviceConfig.Run(wait.NeverStop)
|
||||
|
||||
if s.UseEndpointSlices {
|
||||
if endpointsHandler, ok := s.Proxier.(config.EndpointsHandler); ok && !s.UseEndpointSlices {
|
||||
endpointsConfig := config.NewEndpointsConfig(informerFactory.Core().V1().Endpoints(), s.ConfigSyncPeriod)
|
||||
endpointsConfig.RegisterEventHandler(endpointsHandler)
|
||||
go endpointsConfig.Run(wait.NeverStop)
|
||||
} else {
|
||||
endpointSliceConfig := config.NewEndpointSliceConfig(informerFactory.Discovery().V1().EndpointSlices(), s.ConfigSyncPeriod)
|
||||
endpointSliceConfig.RegisterEventHandler(s.Proxier)
|
||||
go endpointSliceConfig.Run(wait.NeverStop)
|
||||
} else {
|
||||
endpointsConfig := config.NewEndpointsConfig(informerFactory.Core().V1().Endpoints(), s.ConfigSyncPeriod)
|
||||
endpointsConfig.RegisterEventHandler(s.Proxier)
|
||||
go endpointsConfig.Run(wait.NeverStop)
|
||||
}
|
||||
|
||||
// This has to start after the calls to NewServiceConfig and NewEndpointsConfig because those
|
||||
|
Reference in New Issue
Block a user