From 4c5eff116d76ce68b668ea8f01022c42998f5efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Ma=C5=88=C3=A1k?= Date: Fri, 17 Jul 2026 11:54:15 +0200 Subject: [PATCH] Set --max-concurrent-reconciles=10 for AWS machine controller Align AWS with Azure and GCP so the machine-controller can process reconcile queues with higher concurrency during large create waves. --- pkg/operator/sync.go | 2 +- pkg/operator/sync_test.go | 71 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/pkg/operator/sync.go b/pkg/operator/sync.go index 631468f8d7..e948a4b850 100644 --- a/pkg/operator/sync.go +++ b/pkg/operator/sync.go @@ -750,7 +750,7 @@ func newContainers(config *OperatorConfig, features map[string]bool, tlsArgs []s machineControllerArgs := append([]string{}, featureGateArgs...) switch config.PlatformType { - case configv1.AzurePlatformType, configv1.GCPPlatformType: + case configv1.AWSPlatformType, configv1.AzurePlatformType, configv1.GCPPlatformType: machineControllerArgs = append(machineControllerArgs, "--max-concurrent-reconciles=10") case configv1.BareMetalPlatformType: machineControllerArgs = append(machineControllerArgs, tlsArgs...) diff --git a/pkg/operator/sync_test.go b/pkg/operator/sync_test.go index 3066eeb22d..f38d623d08 100644 --- a/pkg/operator/sync_test.go +++ b/pkg/operator/sync_test.go @@ -800,6 +800,77 @@ func TestNewKubeProxyContainers(t *testing.T) { } } +func TestNewContainersMaxConcurrentReconciles(t *testing.T) { + const maxConcurrentReconcilesArg = "--max-concurrent-reconciles=10" + + baseControllers := Controllers{ + Provider: "provider-image:latest", + MachineSet: "machineset-image:latest", + NodeLink: "nodelink-image:latest", + MachineHealthCheck: "mhc-image:latest", + KubeRBACProxy: "kube-rbac-proxy-image:latest", + } + + testCases := []struct { + name string + platformType configv1.PlatformType + expectMaxConcurrentReconciles bool + }{ + { + name: "AWS enables max concurrent reconciles", + platformType: configv1.AWSPlatformType, + expectMaxConcurrentReconciles: true, + }, + { + name: "Azure enables max concurrent reconciles", + platformType: configv1.AzurePlatformType, + expectMaxConcurrentReconciles: true, + }, + { + name: "GCP enables max concurrent reconciles", + platformType: configv1.GCPPlatformType, + expectMaxConcurrentReconciles: true, + }, + { + name: "BareMetal does not enable max concurrent reconciles", + platformType: configv1.BareMetalPlatformType, + expectMaxConcurrentReconciles: false, + }, + { + name: "vSphere does not enable max concurrent reconciles", + platformType: configv1.VSpherePlatformType, + expectMaxConcurrentReconciles: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := NewWithT(t) + + config := &OperatorConfig{ + TargetNamespace: targetNamespace, + PlatformType: tc.platformType, + Controllers: baseControllers, + } + + var machineControllerArgs []string + for _, container := range newContainers(config, map[string]bool{}, nil) { + if container.Name == "machine-controller" { + machineControllerArgs = container.Args + break + } + } + g.Expect(machineControllerArgs).ToNot(BeEmpty(), "machine-controller container should exist") + + if tc.expectMaxConcurrentReconciles { + g.Expect(machineControllerArgs).To(ContainElement(maxConcurrentReconcilesArg)) + } else { + g.Expect(machineControllerArgs).ToNot(ContainElement(maxConcurrentReconcilesArg)) + } + }) + } +} + func TestNewPodTemplateSpecTLSArgs(t *testing.T) { testCases := []struct { name string