-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add AKS adoption e2e test and docs #4697
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4697 +/- ##
=======================================
Coverage 62.35% 62.35%
=======================================
Files 196 196
Lines 16192 16192
=======================================
Hits 10097 10097
Misses 5362 5362
Partials 733 733 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be great to test and document! I left some comments regarding the test, and I'll work on following this doc to see if I can adopt an existing cluster using those steps.
updateResource := []any{"30s", "5s"} | ||
|
||
waitForNoBlockMove := func(obj client.Object) { | ||
waitForBlockMoveGone := []any{"30s", "5s"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these intervals be moved to the intervals section in azure-dev? https://github.com/willie-yao/cluster-api-provider-azure/blob/main/test/e2e/config/azure-dev.yaml#L231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values are pretty specific to this test only, so to me it seems like it's fine to keep them local to this file. Otherwise I always feel like I have a hard time tracking down what these values are.
removeFinalizers(cluster) | ||
shouldNotExist(cluster) | ||
|
||
clusterctl.ApplyClusterTemplateAndWait(ctx, input.ApplyInput, input.ApplyResult) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused on how this test is laid out. Do we orphan this cluster and then adopt it back as a CAPZ cluster? I'm a bit confused where the adoption occurs since the logic here seems to be only related to orphaning the cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could help to add a code comment to separate the logic between orphaning/adopting the cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we orphan this cluster and then adopt it back as a CAPZ cluster?
Yes, that's how I tried to describe it in the doc comment for this function.
I'm a bit confused where the adoption occurs since the logic here seems to be only related to orphaning the cluster.
The ApplyAndWait at the very end is the adoption. "Adoption" isn't really its own separate thing, it's only applying templates that happen to match existing resources.
</aside> | ||
|
||
CAPZ can adopt some AKS clusters created by other means under its management. This works by crafting CAPI and | ||
CAPZ manifests which describe the existing cluster and creating those resources on the CAPI management |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an example of how this is done? Do we just need to match the metadata of the existing cluster and make sure to add the tag? It could help to give an example of what a manually created CAPZ manifest would look like for a default AKS cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit hesitant to put a full example in the docs if we can't automatically verify it stays correct over time. Definitely could add one anyway, but I'd be interested in getting more user feedback that indicates a full example is worthwhile here before committing to maintaining one.
/hold for squash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: b3f940811a807b13fc885b023b32d9543d11f6fa
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mboersma The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@nojnhuh squash away! |
Co-authored-by: Mike Tougeron <[email protected]>
squashed! Had to rebase to pickup the broken link fix, didn't hit any conflicts though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: 26e56c326d31b3e629cfd8b49d66c61a8ebbdd8f
|
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR tests and documents adopting an existing AKS cluster under management by CAPZ using features that already exist in CAPZ.
Thank you to @mtougeron for blazing this trail!
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1173
Special notes for your reviewer:
TODOs:
Release note: