Skip to content

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

Merged

Conversation

richardcase
Copy link
Member

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 in reconcileDelete of the controllers for AWSCluster and AWSManagedControlPlane. 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:

  • squashed commits
  • includes documentation

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]>
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 29, 2022
@k8s-ci-robot
Copy link
Contributor

@richardcase: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot requested review from dthorsen and shivi28 July 29, 2022 11:43
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 29, 2022
@richardcase
Copy link
Member Author

We want this in 1.5 so:

/cherry-pick release-1.5

@k8s-infra-cherrypick-robot

@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:

We want this in 1.5 so:

/cherry-pick release-1.5

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.

@Skarlso
Copy link
Contributor

Skarlso commented Jul 29, 2022

Love the -33000 :D

Copy link
Contributor

@Skarlso Skarlso left a 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 Gets the resource first I assume?

Comment on lines +171 to +176
externalResourceGC := false
if feature.Gates.Enabled(feature.ExternalResourceGC) {
setupLog.Info("enabling external resource garbage collection")
externalResourceGC = true
}

Copy link
Contributor

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]>
@k8s-ci-robot
Copy link
Contributor

@richardcase: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-aws-apidiff-main 7ade599 link false /test pull-cluster-api-provider-aws-apidiff-main

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.

@richardcase
Copy link
Member Author

We can ignore the apidiff changes.

@richardcase
Copy link
Member Author

/test ?

@k8s-ci-robot
Copy link
Contributor

@richardcase: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-apidiff-main
  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-clusterclass
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-apidiff-main
  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test ?

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.

@richardcase
Copy link
Member Author

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

@Skarlso
Copy link
Contributor

Skarlso commented Aug 3, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 3, 2022
@richardcase
Copy link
Member Author

@pydctw @dlipovetsky - i will wait for another lgtm before merging this.

@pydctw
Copy link
Contributor

pydctw commented Aug 3, 2022

/lgtm

@richardcase
Copy link
Member Author

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2022
@k8s-ci-robot k8s-ci-robot merged commit a87fc10 into kubernetes-sigs:main Aug 3, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.x milestone Aug 3, 2022
@k8s-infra-cherrypick-robot

@richardcase: new pull request created: #3646

In response to this:

We want this in 1.5 so:

/cherry-pick release-1.5

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants