Skip to content

AWSMachines not getting created for worker nodes created using AWSMachinePool #5203

@Archisman-Mridha

Description

@Archisman-Mridha

/kind bug

What steps did you take and what happened:
[A clear and concise description of what the bug is.]

I created a MachinePool with some user-defined labels under .spec.template.metadata.labels. The self-managed K8s cluster got provisioned in AWS. The AWSMachine resource corresponding to the control plane EC2 instance got created.

But, for the worker node EC2 instance (managed by that MachinePool), the AWSMachine resource isn't getting created.

CAPA controller manager pod logs :

I1104 09:11:48.845572       1 autoscalinggroup.go:133] "Looking for asg by name" controller="awsmachinepool" con │
│ trollerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AWSMachinePool" AWSMachinePool="capi-cluster/kube │
│ aid-demo-primary" namespace="capi-cluster" reconcileID="e491d561-f2f4-4ece-ba85-841e3db3f4b6" machinePool="capi- │
│ cluster/kubeaid-demo-primary" cluster="capi-cluster/kubeaid-demo" name="kubeaid-demo-primary"                    │
│ I1104 09:11:50.273043       1 launchtemplate.go:73] "checking for existing launch template" controller="awsmachi │
│ nepool" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AWSMachinePool" AWSMachinePool="capi-c │
│ luster/kubeaid-demo-primary" namespace="capi-cluster" name="kubeaid-demo-primary" reconcileID="e491d561-f2f4-4ec │
│ e-ba85-841e3db3f4b6" machinePool="capi-cluster/kubeaid-demo-primary" cluster="capi-cluster/kubeaid-demo"         │
│ I1104 09:11:54.181752       1 awsmachine_controller.go:695] "Deleting unneeded entry from AWS Secret" secretPref │
│ ix="aws.cluster.x-k8s.io/45cd5fb6-2939-44d3-825b-95c3f82c784e"   
"Looking for asg by name" controller="awsmachinepool" controllerGroup="infrastructure.cluster.x-k8s.io" controllerK │
│ I1104 07:35:41.009690       1 launchtemplate.go:73] "checking for existing launch template" controller="aws

The pod keeps logging Looking for asg by name and checking for existing launch template.

Interestingly, if I remove those user-defined labels from under machinePool.spec.template.metadata.labels, everything works perfectly. The AWSMachine resource corresponding to the worker node EC2 instance gets created. And the CAPA controller manager stops logging after Deleting unneeded entry from AWS Secret.

What did you expect to happen:

After the cluster got provisioned, the AWSMachine resource corresponding to the worker node EC2 instance needs to get created.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster API Provider AWS (CAPA) version: v2.7.1
  • Cluster API (CAPI) version: v1.7.2
  • Kubernetes version: v1.31.0
  • OS: Ubuntu 24.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.needs-priorityneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions