/kind bug
What steps did you take and what happened:
When setting AWSCluster.spec.controlPlaneLoadBalancer.loadBalancerType: disabled
to manage the control-plane load balancer externally and providing a custom
spec.controlPlaneEndpoint, control-plane AWSMachine objects never reach the
Running state. Instance creation fails immediately with:
failed to create AWSMachine instance: failed to run controlplane, APIServer ELB not available
Example AWSCluster configuration:
spec:
controlPlaneLoadBalancer:
loadBalancerType: disabled
controlPlaneEndpoint:
host: myCustomDnsRecord
port: 6443
The AWSCluster controller correctly stops managing the LB and marks
LoadBalancerReady as true once spec.controlPlaneEndpoint is populated.
However, the AWSMachine controller still checks
status.network.apiServerELB.dnsName in the instance creation path, which is
never populated when the LB is disabled, causing all control-plane machine
creation to fail permanently.
What did you expect to happen:
When loadBalancerType: disabled and spec.controlPlaneEndpoint is fully
populated, instance creation should proceed without requiring
status.network.apiServerELB.dnsName to be set.
Anything else you would like to add:
The root cause is in instances.go. The guard:
if !scope.IsControlPlaneExternallyManaged() && !scope.IsExternallyManaged() &&
!scope.IsEKSManaged() && s.scope.Network().APIServerELB.DNSName == "" {
does not account for loadBalancerType: disabled. The disabled type is only
handled by the AWSCluster reconciler; the AWSMachine instance creation path
was never updated when disabled was introduced.
Environment:
Cluster-api-provider-aws version: v2.11.1
Kubernetes version (use kubectl version): 1.34
OS (e.g. from /etc/os-release): ubuntu 24.04
/kind bug
What steps did you take and what happened:
When setting
AWSCluster.spec.controlPlaneLoadBalancer.loadBalancerType: disabledto manage the control-plane load balancer externally and providing a custom
spec.controlPlaneEndpoint, control-planeAWSMachineobjects never reach theRunningstate. Instance creation fails immediately with:Example
AWSClusterconfiguration:The AWSCluster controller correctly stops managing the LB and marks
LoadBalancerReadyas true oncespec.controlPlaneEndpointis populated.However, the AWSMachine controller still checks
status.network.apiServerELB.dnsNamein the instance creation path, which isnever populated when the LB is disabled, causing all control-plane machine
creation to fail permanently.
What did you expect to happen:
When
loadBalancerType: disabledandspec.controlPlaneEndpointis fullypopulated, instance creation should proceed without requiring
status.network.apiServerELB.dnsNameto be set.Anything else you would like to add:
The root cause is in
instances.go. The guard:does not account for
loadBalancerType: disabled. The disabled type is onlyhandled by the
AWSClusterreconciler; theAWSMachineinstance creation pathwas never updated when disabled was introduced.
Environment:
Cluster-api-provider-aws version: v2.11.1
Kubernetes version (use kubectl version): 1.34
OS (e.g. from /etc/os-release): ubuntu 24.04