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 Seed controller to controller-runtime #6836

Merged
merged 23 commits into from
Oct 23, 2022

Conversation

rfranzke
Copy link
Member

How to categorize this PR?

/area dev-productivity scalability
/kind enhancement

What this PR does / why we need it:
Refactor the Seed controller to controller-runtime. It consists of three reconcilers, so there are some empty separator commits to allow easy navigation through the PR.

I also used the opportunity to move the reconciliation code out of pkg/operation/seed/seed.go and into the reconciler package (where it actually belongs).
Also, the seed care reconciler now watches ManagedResources and maps them to the Seed which makes the health checks lightning-fast.

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:

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

Release note:

The `ManagedResource`s related to seed system components are now labeled with `gardener.cloud/role=system-component`.

@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 14, 2022
@gardener-prow gardener-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 14, 2022
@rfranzke rfranzke marked this pull request as draft October 15, 2022 09:26
@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
@rfranzke
Copy link
Member Author

/test all

@shafeeqes shafeeqes self-assigned this Oct 17, 2022
@rfranzke
Copy link
Member Author

/test all

@rfranzke
Copy link
Member Author

/test all

@rfranzke
Copy link
Member Author

/test pull-gardener-e2e-kind-migration

@rfranzke rfranzke marked this pull request as ready for review October 17, 2022 08:03
@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 17, 2022
@rfranzke
Copy link
Member Author

/retest

@rfranzke
Copy link
Member Author

/test pull-gardener-e2e-kind

Copy link
Contributor

@shafeeqes shafeeqes left a comment

Choose a reason for hiding this comment

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

Thanks for structuring the commits really well and making it easier to review.
I left some suggestions and questions.
Haven't tested it locally yet.

test/integration/gardenlet/seed/lease/lease_test.go Outdated Show resolved Hide resolved
test/integration/gardenlet/seed/care/care_test.go Outdated Show resolved Hide resolved
pkg/gardenlet/controller/seed/seed/reconciler.go Outdated Show resolved Hide resolved
pkg/gardenlet/controller/seed/seed/add.go Show resolved Hide resolved
The gardenlet is only responsible for exactly one Seed, hence it doesn't make sense to configure more than one concurrent sync.
Otherwise, the gardenlet will generate two identities in case it is not running as a pod since it generates random strings as part of `determineIdentity`.
Once legacy shoot controller is refactored we can safely move it to the `pkg/gardenlet/controllers` package again.
In some cases (for CPM, for example), the gardenlet has to read other `Seed` resources. Without this commit, they aren't available in the cache and the gardenlet does not fallback to making real API requests, hence it fails.
@shafeeqes
Copy link
Contributor

shafeeqes commented Oct 19, 2022

Thanks for addressing the review comments. No more comments from my side.

@rfranzke
Copy link
Member Author

Is there somebody else who plans to review this PR?

Copy link
Contributor

@ary1992 ary1992 left a comment

Choose a reason for hiding this comment

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

Thank you for the well structured PR!
Just have some minor nits and changes.
Apart from that lgtm.

pkg/gardenlet/controller/seed/lease_control.go Outdated Show resolved Hide resolved
test/integration/gardenlet/seed/care/care_test.go Outdated Show resolved Hide resolved
test/integration/gardenlet/seed/seed/seed_test.go Outdated Show resolved Hide resolved
pkg/gardenlet/controller/seed/seed/reconciler_delete.go Outdated Show resolved Hide resolved
@rfranzke
Copy link
Member Author

/test pull-gardener-e2e-kind

@rfranzke
Copy link
Member Author

/test pull-gardener-e2e-kind-ha-multi-zone

@ary1992
Copy link
Contributor

ary1992 commented Oct 20, 2022

Thank you addressing the suggestions.
/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 20, 2022
@rfranzke
Copy link
Member Author

/test pull-gardener-e2e-kind-ha-multi-zone

1 similar comment
@rfranzke
Copy link
Member Author

/test pull-gardener-e2e-kind-ha-multi-zone

@rfranzke
Copy link
Member Author

Test are failing because of #6857, let's wait until this is merged.

@rfranzke
Copy link
Member Author

/test pull-gardener-e2e-kind-ha-multi-zone

@rfranzke
Copy link
Member Author

/approve

@gardener-prow
Copy link
Contributor

gardener-prow bot commented Oct 21, 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 21, 2022
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Oct 21, 2022

@rfranzke: 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-check-vulnerabilities ef4dd06 link false /test pull-gardener-check-vulnerabilities

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.

@rfranzke
Copy link
Member Author

/test pull-gardener-integration

@gardener-prow gardener-prow bot merged commit 98ce217 into gardener:master Oct 23, 2022
@rfranzke rfranzke deleted the refactor/seed-ctrl branch October 23, 2022 12:31
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

3 participants