Skip to content

Commit 88f890e

Browse files
committed
add flag to enable concurrent reconciliation.
1 parent b60d4e6 commit 88f890e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

internal/ingress/controller/config/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const (
2323
defaultRestrictScheme = false
2424
defaultRestrictSchemeNamespace = corev1.NamespaceDefault
2525
defaultSyncRateLimit = 0.3
26+
defaultMaxConcurrentReconciles = 1
2627
)
2728

2829
var (
@@ -42,7 +43,8 @@ type Configuration struct {
4243
DefaultTargetType string
4344
DefaultBackendProtocol string
4445

45-
SyncRateLimit float32
46+
SyncRateLimit float32
47+
MaxConcurrentReconciles int
4648

4749
RestrictScheme bool
4850
RestrictSchemeNamespace string
@@ -80,6 +82,8 @@ func (cfg *Configuration) BindFlags(fs *pflag.FlagSet) {
8082
`Default protocol to use for target groups, must be "HTTP" or "HTTPS"`)
8183
fs.Float32Var(&cfg.SyncRateLimit, "sync-rate-limit", defaultSyncRateLimit,
8284
`Define the sync frequency upper limit`)
85+
fs.IntVar(&cfg.MaxConcurrentReconciles, "max-concurrent-reconciles", defaultMaxConcurrentReconciles,
86+
`Define the maximum of number concurrently running reconcile loops`)
8387
fs.BoolVar(&cfg.RestrictScheme, "restrict-scheme", defaultRestrictScheme,
8488
`Restrict the scheme to internal except for whitelisted namespaces`)
8589
fs.StringVar(&cfg.RestrictSchemeNamespace, "restrict-scheme-namespace", defaultRestrictSchemeNamespace,

internal/ingress/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func Initialize(config *config.Configuration, mgr manager.Manager, mc metric.Col
3333
if err != nil {
3434
return err
3535
}
36-
c, err := controller.New("alb-ingress-controller", mgr, controller.Options{Reconciler: reconciler})
36+
c, err := controller.New("alb-ingress-controller", mgr, controller.Options{Reconciler: reconciler, MaxConcurrentReconciles: config.MaxConcurrentReconciles})
3737
if err != nil {
3838
return err
3939
}

0 commit comments

Comments
 (0)