@@ -54,21 +54,23 @@ var (
54
54
setupLog = ctrl .Log .WithName ("setup" )
55
55
56
56
// 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 {}
72
74
)
73
75
74
76
func init () {
@@ -117,6 +119,12 @@ func InitFlags(fs *pflag.FlagSet) {
117
119
fs .DurationVar (& syncPeriod , "sync-period" , 10 * time .Minute ,
118
120
"The minimum interval at which watched resources are reconciled (e.g. 15m)" )
119
121
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
+
120
128
fs .IntVar (& webhookPort , "webhook-port" , 9443 , "Webhook Server port" )
121
129
122
130
fs .StringVar (& webhookCertDir , "webhook-cert-dir" , "/tmp/k8s-webhook-server/serving-certs/" ,
@@ -125,7 +133,7 @@ func InitFlags(fs *pflag.FlagSet) {
125
133
fs .StringVar (& healthAddr , "health-addr" , ":9440" ,
126
134
"The address the health endpoint binds to." )
127
135
128
- flags .AddDiagnosticsOptions (fs , & diagnosticsOptions )
136
+ flags .AddManagerOptions (fs , & managerOptions )
129
137
}
130
138
131
139
func main () {
@@ -136,7 +144,11 @@ func main() {
136
144
ctrl .SetLogger (textlogger .NewLogger (textlogger .NewConfig ()))
137
145
restConfig := ctrl .GetConfigOrDie ()
138
146
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
+ }
140
152
141
153
var watchNamespaces map [string ]cache.Config
142
154
if watchNamespace != "" {
@@ -158,7 +170,7 @@ func main() {
158
170
RetryPeriod : & leaderElectionRetryPeriod ,
159
171
HealthProbeBindAddress : healthAddr ,
160
172
PprofBindAddress : profilerAddress ,
161
- Metrics : diagnosticsOpts ,
173
+ Metrics : * metricsOptions ,
162
174
Cache : cache.Options {
163
175
DefaultNamespaces : watchNamespaces ,
164
176
SyncPeriod : & syncPeriod ,
@@ -175,6 +187,7 @@ func main() {
175
187
ctrlwebhook.Options {
176
188
Port : webhookPort ,
177
189
CertDir : webhookCertDir ,
190
+ TLSOpts : tlsOptions ,
178
191
},
179
192
),
180
193
}
0 commit comments