@@ -54,21 +54,23 @@ var (
5454 setupLog = ctrl .Log .WithName ("setup" )
5555
5656 // flags.
57- enableLeaderElection bool
58- leaderElectionLeaseDuration time.Duration
59- leaderElectionRenewDeadline time.Duration
60- leaderElectionRetryPeriod time.Duration
61- watchFilterValue string
62- watchNamespace string
63- profilerAddress string
64- enableContentionProfiling bool
65- concurrencyNumber int
66- syncPeriod time.Duration
67- webhookPort int
68- webhookCertDir string
69- healthAddr string
70- watchConfigSecretChanges bool
71- diagnosticsOptions = flags.DiagnosticsOptions {}
57+ enableLeaderElection bool
58+ leaderElectionLeaseDuration time.Duration
59+ leaderElectionRenewDeadline time.Duration
60+ leaderElectionRetryPeriod time.Duration
61+ watchFilterValue string
62+ watchNamespace string
63+ profilerAddress string
64+ enableContentionProfiling bool
65+ concurrencyNumber int
66+ syncPeriod time.Duration
67+ clusterCacheTrackerClientQPS float32
68+ clusterCacheTrackerClientBurst int
69+ webhookPort int
70+ webhookCertDir string
71+ healthAddr string
72+ watchConfigSecretChanges bool
73+ managerOptions = flags.ManagerOptions {}
7274)
7375
7476func init () {
@@ -117,6 +119,12 @@ func InitFlags(fs *pflag.FlagSet) {
117119 fs .DurationVar (& syncPeriod , "sync-period" , 10 * time .Minute ,
118120 "The minimum interval at which watched resources are reconciled (e.g. 15m)" )
119121
122+ fs .Float32Var (& clusterCacheTrackerClientQPS , "clustercachetracker-client-qps" , 20 ,
123+ "Maximum queries per second from the cluster cache tracker clients to the Kubernetes API server of workload clusters." )
124+
125+ fs .IntVar (& clusterCacheTrackerClientBurst , "clustercachetracker-client-burst" , 30 ,
126+ "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." )
127+
120128 fs .IntVar (& webhookPort , "webhook-port" , 9443 , "Webhook Server port" )
121129
122130 fs .StringVar (& webhookCertDir , "webhook-cert-dir" , "/tmp/k8s-webhook-server/serving-certs/" ,
@@ -125,7 +133,7 @@ func InitFlags(fs *pflag.FlagSet) {
125133 fs .StringVar (& healthAddr , "health-addr" , ":9440" ,
126134 "The address the health endpoint binds to." )
127135
128- flags .AddDiagnosticsOptions (fs , & diagnosticsOptions )
136+ flags .AddManagerOptions (fs , & managerOptions )
129137}
130138
131139func main () {
@@ -136,7 +144,11 @@ func main() {
136144 ctrl .SetLogger (textlogger .NewLogger (textlogger .NewConfig ()))
137145 restConfig := ctrl .GetConfigOrDie ()
138146
139- diagnosticsOpts := flags .GetDiagnosticsOptions (diagnosticsOptions )
147+ tlsOptions , metricsOptions , err := flags .GetManagerOptions (managerOptions )
148+ if err != nil {
149+ setupLog .Error (err , "Unable to start manager: invalid flags" )
150+ os .Exit (1 )
151+ }
140152
141153 var watchNamespaces map [string ]cache.Config
142154 if watchNamespace != "" {
@@ -158,7 +170,7 @@ func main() {
158170 RetryPeriod : & leaderElectionRetryPeriod ,
159171 HealthProbeBindAddress : healthAddr ,
160172 PprofBindAddress : profilerAddress ,
161- Metrics : diagnosticsOpts ,
173+ Metrics : * metricsOptions ,
162174 Cache : cache.Options {
163175 DefaultNamespaces : watchNamespaces ,
164176 SyncPeriod : & syncPeriod ,
@@ -175,6 +187,7 @@ func main() {
175187 ctrlwebhook.Options {
176188 Port : webhookPort ,
177189 CertDir : webhookCertDir ,
190+ TLSOpts : tlsOptions ,
178191 },
179192 ),
180193 }
0 commit comments