Skip to content
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

[gardenlet] Switch BackupBucket controller to controller-runtime #6837

Merged
merged 36 commits into from
Nov 9, 2022

Conversation

shafeeqes
Copy link
Contributor

How to categorize this PR?

/area dev-productivity scalability
/kind enhancement

What this PR does / why we need it:
Refactor the BackupBucket controller to controller-runtime.

This PR also adds a field selector for spec.bucketName of BackupEntry.

Which issue(s) this PR fixes:
Part of #4251

Special notes for your reviewer:
Generally, we want to follow this cookbook while refactoring existing controllers:

Add documentation
Add integration test based on envtest (if not already present)
Switch controller to controller-runtime

Release note:

NONE

@gardener-prow gardener-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 15, 2022
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Oct 15, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@gardener-prow gardener-prow bot added area/dev-productivity Developer productivity related (how to improve development) area/scalability Scalability related kind/enhancement Enhancement, improvement, extension cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels Oct 15, 2022
@shafeeqes
Copy link
Contributor Author

/test all

@gardener-prow gardener-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 15, 2022
@shafeeqes shafeeqes changed the title Switch BackupBucket controller to controller-runtime [gardenlet] Switch BackupBucket controller to controller-runtime Oct 15, 2022
@shafeeqes shafeeqes force-pushed the refactor/bb-controller branch 4 times, most recently from 9b387f4 to 76e8a18 Compare October 16, 2022 11:19
@shafeeqes shafeeqes marked this pull request as ready for review October 16, 2022 11:19
@gardener-prow gardener-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 16, 2022
@shafeeqes
Copy link
Contributor Author

stress -ignore "unable to grab random port" -p 12 ./test/integration/gardenlet/backupbucket/backupbucket.test
5s: 0 runs so far, 0 failures
10s: 0 runs so far, 0 failures
...
15m25s: 990 runs so far, 0 failures
15m30s: 997 runs so far, 0 failures
15m35s: 1002 runs so far, 0 failures

@rfranzke
Copy link
Member

/assign

@timebertt
Copy link
Member

Now, that we have the controller-runtime manager with both caches for garden and seed cluster, we could easily set up watches for the extensions/v1alpha1.BackupBucket object in the seed.
This way, we could get rid of the dirty wait loops, flows, etc in the reconcilers and instead do it the "kubernetes-native way", i.e. enqueue the BackupBucket on relevant update events to the owned object.

This was also one motivation behind doing this refactoring in the first place.
@shafeeqes can perform the suggested change?

docs/concepts/gardenlet.md Outdated Show resolved Hide resolved
docs/concepts/gardenlet.md Outdated Show resolved Hide resolved
docs/concepts/gardenlet.md Outdated Show resolved Hide resolved
docs/concepts/gardenlet.md Outdated Show resolved Hide resolved
docs/concepts/gardenlet.md Outdated Show resolved Hide resolved
pkg/controllerutils/eventhandler.go Outdated Show resolved Hide resolved
pkg/gardenlet/controller/add.go Outdated Show resolved Hide resolved
@rfranzke
Copy link
Member

@shafeeqes I would suggest that we first address the review feedback and drive it to a state where there are no further comments until you work on

pkg/api/indexer/core.go Show resolved Hide resolved
pkg/gardenlet/controller/backupbucket/reconciler.go Outdated Show resolved Hide resolved
pkg/gardenlet/controller/backupbucket/reconciler.go Outdated Show resolved Hide resolved
pkg/gardenlet/controller/backupbucket/reconciler.go Outdated Show resolved Hide resolved
@gardener-prow gardener-prow bot removed the cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. label Oct 19, 2022
@plkokanov
Copy link
Contributor

Thanks!
We discussed out of band that a restart of the controller before the reconciliation has finished will not cause problems and once the controller starts the BackupBucket will be requeued immediately, not only once per 24 hours.

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2022
@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2022
Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@gardener-prow gardener-prow bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 8, 2022
@rfranzke
Copy link
Member

rfranzke commented Nov 8, 2022

Thanks, I don't have further comments now! :)

@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2022
@shafeeqes
Copy link
Contributor Author

Ref #6928
/test pull-gardener-integration

@shafeeqes shafeeqes force-pushed the refactor/bb-controller branch 3 times, most recently from eedf2df to bb2c122 Compare November 9, 2022 06:40
@shafeeqes
Copy link
Contributor Author

/hold
I will stress test it to more runs, just to make sure.

@gardener-prow gardener-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 9, 2022
```
stress -ignore "unable to grab random port" -p 32 ./test/integration/gardenlet/backupbucket/backupbucket.test
...
26m10s: 1978 runs so far, 0 failures
26m15s: 1987 runs so far, 0 failures
26m20s: 1993 runs so far, 0 failures
26m25s: 1998 runs so far, 0 failures
26m30s: 2004 runs so far, 0 failures
26m35s: 2010 runs so far, 0 failures
```
@shafeeqes
Copy link
Contributor Author

$ stress -ignore "unable to grab random port" -p 32 ./test/integration/gardenlet/backupbucket/backupbucket.test                                                                                                                   
5s: 0 runs so far, 0 failures
10s: 0 runs so far, 0 failures
...
26m20s: 1993 runs so far, 0 failures
26m25s: 1998 runs so far, 0 failures
26m30s: 2004 runs so far, 0 failures
26m35s: 2010 runs so far, 0 failures

No flakes so far.
/unhold

@gardener-prow gardener-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 9, 2022
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Nov 9, 2022

@shafeeqes: 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-gardener-apidiff 31355f2 link false /test pull-gardener-apidiff

Full PR test history. Your PR dashboard. Command help for this repository.
Please help us cut down on flakes by linking this test failure to an open flake report or filing a new flake report if you can't find an existing one. Also see our testing guideline for how to avoid and hunt flakes.

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.

Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Nov 9, 2022
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Nov 9, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rfranzke

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

@gardener-prow gardener-prow bot merged commit b9a7250 into gardener:master Nov 9, 2022
@shafeeqes shafeeqes deleted the refactor/bb-controller branch November 9, 2022 14:31
@rfranzke rfranzke changed the title [gardenlet] Switch BackupBucket controller to controller-runtime [gardenlet] Switch BackupBucket controller to controller-runtime Dec 14, 2022
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. area/dev-productivity Developer productivity related (how to improve development) area/scalability Scalability related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. 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.

None yet

4 participants