mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 13:42:02 +00:00
Merge pull request #80509 from mborsz/endpoints
Add simple pod updates batching to endpoint controller.
This commit is contained in:
@@ -300,6 +300,7 @@ func startEndpointController(ctx ControllerContext) (http.Handler, bool, error)
|
||||
ctx.InformerFactory.Core().V1().Services(),
|
||||
ctx.InformerFactory.Core().V1().Endpoints(),
|
||||
ctx.ClientBuilder.ClientOrDie("endpoint-controller"),
|
||||
ctx.ComponentConfig.EndpointController.EndpointUpdatesBatchPeriod.Duration,
|
||||
).Run(int(ctx.ComponentConfig.EndpointController.ConcurrentEndpointSyncs), ctx.Stop)
|
||||
return nil, true, nil
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@ func (o *EndpointControllerOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
}
|
||||
|
||||
fs.Int32Var(&o.ConcurrentEndpointSyncs, "concurrent-endpoint-syncs", o.ConcurrentEndpointSyncs, "The number of endpoint syncing operations that will be done concurrently. Larger number = faster endpoint updating, but more CPU (and network) load")
|
||||
fs.DurationVar(&o.EndpointUpdatesBatchPeriod.Duration, "endpoint-updates-batch-period", o.EndpointUpdatesBatchPeriod.Duration, "The length of endpoint updates batching period. Processing of pod changes will be delayed by this duration to join them with potential upcoming updates and reduce the overall number of endpoints updates. Larger number = higher endpoint programming latency, but lower number of endpoints revision generated")
|
||||
}
|
||||
|
||||
// ApplyTo fills up EndPointController config with options.
|
||||
@@ -43,6 +44,7 @@ func (o *EndpointControllerOptions) ApplyTo(cfg *endpointconfig.EndpointControll
|
||||
}
|
||||
|
||||
cfg.ConcurrentEndpointSyncs = o.ConcurrentEndpointSyncs
|
||||
cfg.EndpointUpdatesBatchPeriod = o.EndpointUpdatesBatchPeriod
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user