@@ -65,16 +65,18 @@ var (
6565 logOptions = logs .NewOptions ()
6666 controllerName = "cluster-api-vsphere-manager"
6767
68- enableContentionProfiling bool
69- leaderElectionLeaseDuration time.Duration
70- leaderElectionRenewDeadline time.Duration
71- leaderElectionRetryPeriod time.Duration
72- managerOpts manager.Options
73- restConfigBurst int
74- restConfigQPS float32
75- syncPeriod time.Duration
76- webhookOpts webhook.Options
77- watchNamespace string
68+ enableContentionProfiling bool
69+ leaderElectionLeaseDuration time.Duration
70+ leaderElectionRenewDeadline time.Duration
71+ leaderElectionRetryPeriod time.Duration
72+ managerOpts manager.Options
73+ restConfigBurst int
74+ restConfigQPS float32
75+ clusterCacheTrackerClientQPS float32
76+ clusterCacheTrackerClientBurst int
77+ syncPeriod time.Duration
78+ webhookOpts webhook.Options
79+ watchNamespace string
7880
7981 clusterCacheTrackerConcurrency int
8082 vSphereClusterConcurrency int
8587 vSphereClusterIdentityConcurrency int
8688 vSphereDeploymentZoneConcurrency int
8789
88- tlsOptions = capiflags.TLSOptions {}
89- diagnosticsOptions = capiflags.DiagnosticsOptions {}
90+ managerOptions = capiflags.ManagerOptions {}
9091
9192 defaultProfilerAddr = os .Getenv ("PROFILER_ADDR" )
9293 defaultSyncPeriod = manager .DefaultSyncPeriod
@@ -181,10 +182,16 @@ func InitFlags(fs *pflag.FlagSet) {
181182 "The minimum interval at which watched resources are reconciled (e.g. 15m)" )
182183
183184 fs .Float32Var (& restConfigQPS , "kube-api-qps" , 20 ,
184- "Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20 " )
185+ "Maximum queries per second from the controller client to the Kubernetes API server." )
185186
186187 fs .IntVar (& restConfigBurst , "kube-api-burst" , 30 ,
187- "Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default 30" )
188+ "Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server." )
189+
190+ fs .Float32Var (& clusterCacheTrackerClientQPS , "clustercachetracker-client-qps" , 20 ,
191+ "Maximum queries per second from the cluster cache tracker clients to the Kubernetes API server of workload clusters." )
192+
193+ fs .IntVar (& clusterCacheTrackerClientBurst , "clustercachetracker-client-burst" , 30 ,
194+ "Maximum number of queries that should be allowed in one burst from the cluster cache tracker clients to the Kubernetes API server of workload clusters." )
188195
189196 fs .IntVar (& webhookOpts .Port , "webhook-port" , defaultWebhookPort ,
190197 "Webhook Server port" )
@@ -196,8 +203,7 @@ func InitFlags(fs *pflag.FlagSet) {
196203 "The address the health endpoint binds to." ,
197204 )
198205
199- capiflags .AddTLSOptions (fs , & tlsOptions )
200- capiflags .AddDiagnosticsOptions (fs , & diagnosticsOptions )
206+ capiflags .AddManagerOptions (fs , & managerOptions )
201207 feature .MutableGates .AddFlag (fs )
202208}
203209
@@ -298,15 +304,15 @@ func main() {
298304 return nil
299305 }
300306
301- tlsOptionOverrides , err := capiflags .GetTLSOptionOverrideFuncs ( tlsOptions )
307+ tlsOptions , metricsOptions , err := capiflags .GetManagerOptions ( managerOptions )
302308 if err != nil {
303- setupLog .Error (err , "unable to add TLS settings to the webhook server " )
309+ setupLog .Error (err , "Unable to start manager: invalid flags " )
304310 os .Exit (1 )
305311 }
306- webhookOpts .TLSOpts = tlsOptionOverrides
312+ webhookOpts .TLSOpts = tlsOptions
307313 managerOpts .WebhookServer = webhook .NewServer (webhookOpts )
308314 managerOpts .AddToManager = addToManager
309- managerOpts .Metrics = capiflags . GetDiagnosticsOptions ( diagnosticsOptions )
315+ managerOpts .Metrics = * metricsOptions
310316
311317 // Set up the context that's going to be used in controllers and for the manager.
312318 ctx := ctrl .SetupSignalHandler ()
@@ -446,6 +452,8 @@ func setupRemoteClusterCacheTracker(ctx context.Context, mgr ctrlmgr.Manager) (*
446452 SecretCachingClient : secretCachingClient ,
447453 ControllerName : controllerName ,
448454 Log : & ctrl .Log ,
455+ ClientQPS : clusterCacheTrackerClientQPS ,
456+ ClientBurst : clusterCacheTrackerClientBurst ,
449457 },
450458 )
451459 if err != nil {
0 commit comments