Skip to content

Commit

Permalink
no watch endpointslice in userpace mode
Browse files Browse the repository at this point in the history
  • Loading branch information
JornShen committed Apr 27, 2021
1 parent 5e1f5e6 commit 87e34b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion cmd/kube-proxy/app/server_others.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,12 @@ func newProxyServer(
}
}

useEndpointSlices := utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceProxying)
if proxyMode == proxyModeUserspace {
// userspace mode doesn't support endpointslice.
useEndpointSlices = false
}

return &ProxyServer{
Client: client,
EventClient: eventClient,
Expand All @@ -384,7 +390,7 @@ func newProxyServer(
OOMScoreAdj: config.OOMScoreAdj,
ConfigSyncPeriod: config.ConfigSyncPeriod.Duration,
HealthzServer: healthzServer,
UseEndpointSlices: utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceProxying),
UseEndpointSlices: useEndpointSlices,
}, nil
}

Expand Down
8 changes: 6 additions & 2 deletions cmd/kube-proxy/app/server_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi
return nil, fmt.Errorf("unable to create proxier: %v", err)
}
}

useEndpointSlices := utilfeature.DefaultFeatureGate.Enabled(features.WindowsEndpointSliceProxying)
if proxyMode == proxyModeUserspace {
// userspace mode doesn't support endpointslice.
useEndpointSlices = false
}
return &ProxyServer{
Client: client,
EventClient: eventClient,
Expand All @@ -175,7 +179,7 @@ func newProxyServer(config *proxyconfigapi.KubeProxyConfiguration, cleanupAndExi
OOMScoreAdj: config.OOMScoreAdj,
ConfigSyncPeriod: config.ConfigSyncPeriod.Duration,
HealthzServer: healthzServer,
UseEndpointSlices: utilfeature.DefaultFeatureGate.Enabled(features.WindowsEndpointSliceProxying),
UseEndpointSlices: useEndpointSlices,
}, nil
}

Expand Down

0 comments on commit 87e34b3

Please sign in to comment.