...
1
16
17 package options
18
19 import (
20 "github.com/spf13/pflag"
21
22 endpointconfig "k8s.io/kubernetes/pkg/controller/endpoint/config"
23 )
24
25
26 type EndpointControllerOptions struct {
27 *endpointconfig.EndpointControllerConfiguration
28 }
29
30
31 func (o *EndpointControllerOptions) AddFlags(fs *pflag.FlagSet) {
32 if o == nil {
33 return
34 }
35
36 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")
37 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")
38 }
39
40
41 func (o *EndpointControllerOptions) ApplyTo(cfg *endpointconfig.EndpointControllerConfiguration) error {
42 if o == nil {
43 return nil
44 }
45
46 cfg.ConcurrentEndpointSyncs = o.ConcurrentEndpointSyncs
47 cfg.EndpointUpdatesBatchPeriod = o.EndpointUpdatesBatchPeriod
48
49 return nil
50 }
51
52
53 func (o *EndpointControllerOptions) Validate() []error {
54 if o == nil {
55 return nil
56 }
57
58 errs := []error{}
59 return errs
60 }
61
View as plain text