@@ -34,7 +34,6 @@ import (
34
34
"sigs.k8s.io/cluster-api-operator/internal/webhook"
35
35
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
36
36
clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3"
37
- "sigs.k8s.io/cluster-api/controllers/remote"
38
37
"sigs.k8s.io/cluster-api/util/flags"
39
38
"sigs.k8s.io/cluster-api/version"
40
39
ctrl "sigs.k8s.io/controller-runtime"
@@ -55,23 +54,21 @@ var (
55
54
setupLog = ctrl .Log .WithName ("setup" )
56
55
57
56
// flags.
58
- enableLeaderElection bool
59
- leaderElectionLeaseDuration time.Duration
60
- leaderElectionRenewDeadline time.Duration
61
- leaderElectionRetryPeriod time.Duration
62
- watchFilterValue string
63
- watchNamespace string
64
- profilerAddress string
65
- enableContentionProfiling bool
66
- concurrencyNumber int
67
- syncPeriod time.Duration
68
- clusterCacheTrackerClientQPS float32
69
- clusterCacheTrackerClientBurst int
70
- webhookPort int
71
- webhookCertDir string
72
- healthAddr string
73
- watchConfigSecretChanges bool
74
- managerOptions = flags.ManagerOptions {}
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
+ managerOptions = flags.ManagerOptions {}
75
72
)
76
73
77
74
func init () {
@@ -120,12 +117,6 @@ func InitFlags(fs *pflag.FlagSet) {
120
117
fs .DurationVar (& syncPeriod , "sync-period" , 10 * time .Minute ,
121
118
"The minimum interval at which watched resources are reconciled (e.g. 15m)" )
122
119
123
- fs .Float32Var (& clusterCacheTrackerClientQPS , "clustercachetracker-client-qps" , 20 ,
124
- "Maximum queries per second from the cluster cache tracker clients to the Kubernetes API server of workload clusters." )
125
-
126
- fs .IntVar (& clusterCacheTrackerClientBurst , "clustercachetracker-client-burst" , 30 ,
127
- "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." )
128
-
129
120
fs .IntVar (& webhookPort , "webhook-port" , 9443 , "Webhook Server port" )
130
121
131
122
fs .StringVar (& webhookCertDir , "webhook-cert-dir" , "/tmp/k8s-webhook-server/serving-certs/" ,
@@ -228,39 +219,11 @@ func setupChecks(mgr ctrl.Manager) {
228
219
}
229
220
230
221
func setupReconcilers (mgr ctrl.Manager , watchConfigSecretChanges bool ) {
231
- secretCachingClient , err := client .New (mgr .GetConfig (), client.Options {
232
- HTTPClient : mgr .GetHTTPClient (),
233
- Cache : & client.CacheOptions {
234
- Reader : mgr .GetCache (),
235
- },
236
- })
237
- if err != nil {
238
- setupLog .Error (err , "unable to create secret caching client" )
239
- os .Exit (1 )
240
- }
241
- // Set up a ClusterCacheTracker and ClusterCacheReconciler to provide to controllers
242
- // requiring a connection to a remote cluster
243
- tracker , err := remote .NewClusterCacheTracker (
244
- mgr ,
245
- remote.ClusterCacheTrackerOptions {
246
- SecretCachingClient : secretCachingClient ,
247
- ControllerName : "cluster-api-operator-controller" ,
248
- Log : & ctrl .Log ,
249
- ClientQPS : clusterCacheTrackerClientQPS ,
250
- ClientBurst : clusterCacheTrackerClientBurst ,
251
- },
252
- )
253
- if err != nil {
254
- setupLog .Error (err , "Unable to create cluster cache tracker" )
255
- os .Exit (1 )
256
- }
257
-
258
222
if err := (& providercontroller.GenericProviderReconciler {
259
223
Provider : & operatorv1.CoreProvider {},
260
224
ProviderList : & operatorv1.CoreProviderList {},
261
225
Client : mgr .GetClient (),
262
226
Config : mgr .GetConfig (),
263
- Tracker : tracker ,
264
227
WatchConfigSecretChanges : watchConfigSecretChanges ,
265
228
}).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
266
229
setupLog .Error (err , "unable to create controller" , "controller" , "CoreProvider" )
@@ -272,7 +235,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
272
235
ProviderList : & operatorv1.InfrastructureProviderList {},
273
236
Client : mgr .GetClient (),
274
237
Config : mgr .GetConfig (),
275
- Tracker : tracker ,
276
238
WatchConfigSecretChanges : watchConfigSecretChanges ,
277
239
}).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
278
240
setupLog .Error (err , "unable to create controller" , "controller" , "InfrastructureProvider" )
@@ -284,7 +246,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
284
246
ProviderList : & operatorv1.BootstrapProviderList {},
285
247
Client : mgr .GetClient (),
286
248
Config : mgr .GetConfig (),
287
- Tracker : tracker ,
288
249
WatchConfigSecretChanges : watchConfigSecretChanges ,
289
250
}).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
290
251
setupLog .Error (err , "unable to create controller" , "controller" , "BootstrapProvider" )
@@ -296,7 +257,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
296
257
ProviderList : & operatorv1.ControlPlaneProviderList {},
297
258
Client : mgr .GetClient (),
298
259
Config : mgr .GetConfig (),
299
- Tracker : tracker ,
300
260
WatchConfigSecretChanges : watchConfigSecretChanges ,
301
261
}).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
302
262
setupLog .Error (err , "unable to create controller" , "controller" , "ControlPlaneProvider" )
@@ -308,7 +268,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
308
268
ProviderList : & operatorv1.AddonProviderList {},
309
269
Client : mgr .GetClient (),
310
270
Config : mgr .GetConfig (),
311
- Tracker : tracker ,
312
271
WatchConfigSecretChanges : watchConfigSecretChanges ,
313
272
}).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
314
273
setupLog .Error (err , "unable to create controller" , "controller" , "AddonProvider" )
@@ -320,7 +279,6 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
320
279
ProviderList : & operatorv1.IPAMProviderList {},
321
280
Client : mgr .GetClient (),
322
281
Config : mgr .GetConfig (),
323
- Tracker : tracker ,
324
282
WatchConfigSecretChanges : watchConfigSecretChanges ,
325
283
}).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
326
284
setupLog .Error (err , "unable to create controller" , "controller" , "IPAMProvider" )
@@ -332,16 +290,14 @@ func setupReconcilers(mgr ctrl.Manager, watchConfigSecretChanges bool) {
332
290
ProviderList : & operatorv1.RuntimeExtensionProviderList {},
333
291
Client : mgr .GetClient (),
334
292
Config : mgr .GetConfig (),
335
- Tracker : tracker ,
336
293
WatchConfigSecretChanges : watchConfigSecretChanges ,
337
294
}).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
338
295
setupLog .Error (err , "unable to create controller" , "controller" , "RuntimeExtensionProvider" )
339
296
os .Exit (1 )
340
297
}
341
298
342
299
if err := (& healtchcheckcontroller.ProviderHealthCheckReconciler {
343
- Client : mgr .GetClient (),
344
- Tracker : tracker ,
300
+ Client : mgr .GetClient (),
345
301
}).SetupWithManager (mgr , concurrency (concurrencyNumber )); err != nil {
346
302
setupLog .Error (err , "unable to create controller" , "controller" , "Healthcheck" )
347
303
os .Exit (1 )
0 commit comments