-
Notifications
You must be signed in to change notification settings - Fork 602
feat: external load balancer garbage collection (part 3) - add gc to reconciliation #3633
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
feat: external load balancer garbage collection (part 3) - add gc to reconciliation #3633
Conversation
This change uses the new garbage collection service enables this during the reconciliation of `AWSCluster` and `AWSManagedControlPlane`. Its enabled via a new feature flag `ExternalResourceGC` which is disabled by default. If the feature flag is enabled then the the gc service is called in `reconcileDelete` for the infra clusters. The actual gc service does the work of cleanup. New commands have been added to `clusterawsadm` to allow users to opt-in/out an already existing cluster from garbage collection. Additionally, with the new mocks folder introduced with the gc service the existing mocks have been deleted and tests/controllers updated. Signed-off-by: Richard Case <[email protected]>
@richardcase: This issue is currently awaiting triage. If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the The 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/test-infra repository. |
We want this in 1.5 so: /cherry-pick release-1.5 |
@richardcase: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you. In response to this:
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/test-infra repository. |
Love the -33000 :D |
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.
A couple of nits and remarks and two outstanding questions around the documentation. Overall, I have just one question about the patch helper. I assume it handles out-of-sync resources like it just throws an error if the resource happened to be at a different revision. So it Get
s the resource first I assume?
externalResourceGC := false | ||
if feature.Gates.Enabled(feature.ExternalResourceGC) { | ||
setupLog.Info("enabling external resource garbage collection") | ||
externalResourceGC = true | ||
} | ||
|
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 think this belongs in the enableGates
function, but I understand why it does not, at the moment: We need do this before we initialize AWSClusterReconciler, which we do before we call enableGates
.
Various changes as a result of review feedback. Signed-off-by: Richard Case <[email protected]>
@richardcase: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
We can ignore the apidiff changes. |
/test ? |
@richardcase: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
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/test-infra repository. |
/test pull-cluster-api-provider-aws-e2e |
/lgtm |
@pydctw @dlipovetsky - i will wait for another lgtm before merging this. |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: richardcase 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 |
@richardcase: new pull request created: #3646 In response to this:
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/test-infra repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This change allows the new garbage collection service to be used. Its enabled via a new feature flag
ExternalResourceGC
which is disabled by default. If the feature flag is enabled then the gc service is called inreconcileDelete
of the controllers forAWSCluster
andAWSManagedControlPlane
. The actual gc service does the work of clean-up.New commands have been added to
clusterawsadm
to allow users to opt-in/out an already existing cluster from garbage collection. This can also be accomplished adding the annotation manually.Additionally, with the new mocks folder introduced with the gc service the existing mocks have been deleted and tests/controllers updated.
NOTE: the e2e tests will be in part 4
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Relates #1718
Special notes for your reviewer:
This part 3 of 4 of changes (i.e. a stack) to implement the garbage collection. This is work to split up the original pr #3518
Checklist: