Skip to content

✨ feat(awsmanagedcontrolplane): support resource marked as externally managed#6034

Open
aidan-canva wants to merge 4 commits into
kubernetes-sigs:mainfrom
aidan-canva:aidan-awsmanagecontrolplane-externally-managed
Open

✨ feat(awsmanagedcontrolplane): support resource marked as externally managed#6034
aidan-canva wants to merge 4 commits into
kubernetes-sigs:mainfrom
aidan-canva:aidan-awsmanagecontrolplane-externally-managed

Conversation

@aidan-canva

@aidan-canva aidan-canva commented May 28, 2026

Copy link
Copy Markdown

What type of PR is this?
/kind feature

What this PR does / why we need it:
Adds support for AWSManagedControlPlane resources to be marked as externally managed using the standard cluster.x-k8s.io/managed-by annotation. This allows operators to use CAPI/CAPA to manage machines with pre-existing EKS clusters managed by external-systems (eg, Terraform).

Which issue(s) this PR fixes:
Fixes #6031

Special notes for your reviewer:
The second test added is a little redundant with the existing TestAWSManagedControlPlaneReconcilerIntegrationTests test but IMO a positive/negative check sitting close together will make identifying a regression easier in the future.

I'm not sure how detailed to go in the docs. Too detailed and it'll likely just become out of date quickly as the status/conditions required will change as the internal controllers logic changes. IMO it's a pretty 'power-user' feature so some thing can be left up to the operator to determine for their environment, like the kubeconfig credential generation. Alternatively we could to a longer/more detailed guide.

AI Usage:
My usage of CAPA doesn't extend to all of its features, so AI was used as an additional review before opening the PR and to try and capture any missed status/conditions or fields required for a minimal working AWSManagedControlPlane resource that's externally managed.

Checklist:

  • squashed commits
  • includes documentation
  • includes AI generated content
  • includes emoji in title
  • adds unit tests
  • adds or updates e2e tests

Release note:

Support for externally managed `AWSManagedControlPlane` resources using the `cluster.x-k8s.io/managed-by` annotation.

…to be marked as externally managed using annotation
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels May 28, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign neolit123 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added needs-priority cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 28, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @aidan-canva!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 28, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @aidan-canva. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 28, 2026
@richardcase

Copy link
Copy Markdown
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 28, 2026
@richardcase

Copy link
Copy Markdown
Member

@aidan-canva - how feasible do you think it to create a new e2e test that covers this scenario?

@aidan-canva

Copy link
Copy Markdown
Author

@richardcase I will take a look and give it a crack (and fix the failing test)

@aidan-canva

Copy link
Copy Markdown
Author

/retest

@richardcase

Copy link
Copy Markdown
Member

@aidan-canva - if i can help with the e2e let me know. We could always jump on a call if needed.

@aidan-canva

Copy link
Copy Markdown
Author

/test ?

@aidan-canva

Copy link
Copy Markdown
Author

/test pull-cluster-api-provider-aws-e2e-eks

@aidan-canva

Copy link
Copy Markdown
Author

Apologies for the delay @richardcase , unfortunately got a bit sidetracked.

I've put a basic E2E in place ... but it's a bit of a struggle to run this suite in my local-envs (fortunately it seems CI might pass 🤞 ). I'm not a huge fan of the negative test (wait x to prove it didn't do something) structure but couldn't think of a better way to validate this cleanly. Keen to hear some thoughts.

@aidan-canva

Copy link
Copy Markdown
Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support marking AWSManagedControlPlane as externally managed

3 participants