mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #15682 from smarterclayton/make_proxy_resync_longer
Auto commit by PR queue bot
This commit is contained in:
commit
e12019c658
@ -60,7 +60,8 @@ type ProxyServerConfig struct {
|
||||
PortRange util.PortRange
|
||||
HostnameOverride string
|
||||
ProxyMode string
|
||||
SyncPeriod time.Duration
|
||||
IptablesSyncPeriod time.Duration
|
||||
ConfigSyncPeriod time.Duration
|
||||
nodeRef *api.ObjectReference // Reference to this node.
|
||||
MasqueradeAll bool
|
||||
CleanupAndExit bool
|
||||
@ -87,7 +88,8 @@ func (s *ProxyServerConfig) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.Var(&s.PortRange, "proxy-port-range", "Range of host ports (beginPort-endPort, inclusive) that may be consumed in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen.")
|
||||
fs.StringVar(&s.HostnameOverride, "hostname-override", s.HostnameOverride, "If non-empty, will use this string as identification instead of the actual hostname.")
|
||||
fs.StringVar(&s.ProxyMode, "proxy-mode", "", "Which proxy mode to use: 'userspace' (older, stable) or 'iptables' (experimental). If blank, look at the Node object on the Kubernetes API and respect the '"+experimentalProxyModeAnnotation+"' annotation if provided. Otherwise use the best-available proxy (currently userspace, but may change in future versions). If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy.")
|
||||
fs.DurationVar(&s.SyncPeriod, "iptables-sync-period", s.SyncPeriod, "How often iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0.")
|
||||
fs.DurationVar(&s.IptablesSyncPeriod, "iptables-sync-period", s.IptablesSyncPeriod, "How often iptables rules are refreshed (e.g. '5s', '1m', '2h22m'). Must be greater than 0.")
|
||||
fs.DurationVar(&s.ConfigSyncPeriod, "config-sync-period", s.ConfigSyncPeriod, "How often configuration from the apiserver is refreshed. Must be greater than 0.")
|
||||
fs.BoolVar(&s.MasqueradeAll, "masquerade-all", false, "If using the pure iptables proxy, SNAT everything")
|
||||
fs.BoolVar(&s.CleanupAndExit, "cleanup-iptables", false, "If true cleanup iptables rules and exit.")
|
||||
fs.Float32Var(&s.KubeApiQps, "kube-api-qps", s.KubeApiQps, "QPS to use while talking with kubernetes apiserver")
|
||||
@ -115,7 +117,8 @@ func NewProxyConfig() *ProxyServerConfig {
|
||||
HealthzBindAddress: net.ParseIP("127.0.0.1"),
|
||||
OOMScoreAdj: qos.KubeProxyOOMScoreAdj,
|
||||
ResourceContainer: "/kube-proxy",
|
||||
SyncPeriod: 30 * time.Second,
|
||||
IptablesSyncPeriod: 30 * time.Second,
|
||||
ConfigSyncPeriod: 15 * time.Minute,
|
||||
KubeApiQps: 5.0,
|
||||
KubeApiBurst: 10,
|
||||
}
|
||||
@ -217,7 +220,7 @@ func NewProxyServerDefault(config *ProxyServerConfig) (*ProxyServer, error) {
|
||||
|
||||
if useIptablesProxy {
|
||||
glog.V(2).Info("Using iptables Proxier.")
|
||||
proxierIptables, err := iptables.NewProxier(iptInterface, execer, config.SyncPeriod, config.MasqueradeAll)
|
||||
proxierIptables, err := iptables.NewProxier(iptInterface, execer, config.IptablesSyncPeriod, config.MasqueradeAll)
|
||||
if err != nil {
|
||||
glog.Fatalf("Unable to create proxier: %v", err)
|
||||
}
|
||||
@ -234,7 +237,7 @@ func NewProxyServerDefault(config *ProxyServerConfig) (*ProxyServer, error) {
|
||||
// set EndpointsConfigHandler to our loadBalancer
|
||||
endpointsHandler = loadBalancer
|
||||
|
||||
proxierUserspace, err := userspace.NewProxier(loadBalancer, config.BindAddress, iptInterface, config.PortRange, config.SyncPeriod)
|
||||
proxierUserspace, err := userspace.NewProxier(loadBalancer, config.BindAddress, iptInterface, config.PortRange, config.IptablesSyncPeriod)
|
||||
if err != nil {
|
||||
glog.Fatalf("Unable to create proxier: %v", err)
|
||||
}
|
||||
@ -257,7 +260,7 @@ func NewProxyServerDefault(config *ProxyServerConfig) (*ProxyServer, error) {
|
||||
|
||||
proxyconfig.NewSourceAPI(
|
||||
client,
|
||||
30*time.Second,
|
||||
config.ConfigSyncPeriod,
|
||||
serviceConfig.Channel("api"),
|
||||
endpointsConfig.Channel("api"),
|
||||
)
|
||||
|
@ -46,6 +46,7 @@ cluster-domain
|
||||
cluster-name
|
||||
cluster-tag
|
||||
concurrent-endpoint-syncs
|
||||
config-sync-period
|
||||
configure-cbr0
|
||||
contain-pod-resources
|
||||
container-port
|
||||
|
Loading…
Reference in New Issue
Block a user