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

POC: Refactoring - moving seed determiner logic into dedicated struct #9843

Closed
wants to merge 2 commits into from

Conversation

tobiscr
Copy link
Contributor

@tobiscr tobiscr commented May 24, 2024

How to categorize this PR?

/area control-plane

What this PR does / why we need it:
We have a feature-request on Kyma side to offer customers an option to enforce that a seed and shoot are running in the same region. Our goal is to validate whether a seed would be available in a region before creating a shoot. This saves processing time on Gardener side and allows short roundtrip-times on our side in case of non-matching seed clusters.

This PR is a pure refactoring of the Gardener reconciler which is moving logic related to determine the seed into a separate struct. No functional changes were applied, just code re-arrangements. The introduced SeedDeterminer is also visible outside of ths shoot-package which would allow us to reuse the logic in our application.

The change improves also a bit the separation of concerns within the logic. The reconciler is purely responsible for reconciliations, the seed-determiner does nothing beside determining the seed cluster.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Release note:


@gardener-prow gardener-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/control-plane Control plane related labels May 24, 2024
@CLAassistant
Copy link

CLAassistant commented May 24, 2024

CLA assistant check
All committers have signed the CLA.

@gardener-prow gardener-prow bot added the do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label May 24, 2024
Copy link
Contributor

gardener-prow bot commented May 24, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ialidzhikov for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link
Contributor

gardener-prow bot commented May 24, 2024

Welcome @tobiscr!

It looks like this is your first PR to gardener/gardener 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if gardener/gardener has its own contribution guidelines.

Thank you, and welcome to Gardener. 😃

@gardener-prow gardener-prow bot requested a review from ialidzhikov May 24, 2024 11:33
@gardener-prow gardener-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 24, 2024
@gardener-prow gardener-prow bot requested a review from ScheererJ May 24, 2024 11:33
Copy link
Contributor

gardener-prow bot commented May 24, 2024

Hi @tobiscr. Thanks for your PR.

I'm waiting for a gardener member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@gardener-prow gardener-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels May 24, 2024
@tobiscr tobiscr changed the title POC: Refactoring - moving seed determiner logic into dedicated strict POC: Refactoring - moving seed determiner logic into dedicated struct May 24, 2024
@tobiscr
Copy link
Contributor Author

tobiscr commented May 28, 2024

After a call with @ScheererJ we agreed on following options for the seed determining logic:

  1. We change the visibility of the determineSeed function (from determineSeed to DetermineSeed) on the current Reconciler to make it public accessible and consumable for other applications (challenge could be to set the right strategy for detecting a suitable seed as it's depending on the Shoot purpose)
  2. We consider the proposed PR and extract the determineSeed logic into a new struct (challenge could be to set the right strategy for detecting a suitable seed as it's depending on the Shoot purpose)
  3. The other application implements their own determining logic by checking for the existence of a seed in this region

@ScheererJ is getting in contact with a team colleague to discuss these options and will reply in the coming 1-2 weeks with a suggestion how to proceed.

@ScheererJ
Copy link
Member

After a call with @ScheererJ we agreed on following options for the seed determining logic:

  1. We change the visibility of the determineSeed function (from determineSeed to DetermineSeed) on the current Reconciler to make it public accessible and consumable for other applications (challenge could be to set the right strategy for detecting a suitable seed as it's depending on the Shoot purpose)
  2. We consider the proposed PR and extract the determineSeed logic into a new struct (challenge could be to set the right strategy for detecting a suitable seed as it's depending on the Shoot purpose)
  3. The other application implements their own determining logic by checking for the existence of a seed in this region

@ScheererJ is getting in contact with a team colleague to discuss these options and will reply in the coming 1-2 weeks with a suggestion how to proceed.

After offline discussion, option 1 seems to be a simple and acceptable solution. Please adapt the pull request accordingly.

Please note that a general option to enforce same region seed clusters in scheduling may be something for a future gardener hackathon. Let me know if you would like to join :-) .

@ScheererJ
Copy link
Member

/assign

@gardener-ci-robot
Copy link
Contributor

The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:

  • After 15d of inactivity, lifecycle/stale is applied
  • After 15d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 7d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Mark this PR as rotten with /lifecycle rotten
  • Close this PR with /close

/lifecycle stale

@gardener-prow gardener-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 15, 2024
@gardener-ci-robot
Copy link
Contributor

The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:

  • After 15d of inactivity, lifecycle/stale is applied
  • After 15d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 7d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close

/lifecycle rotten

@gardener-prow gardener-prow bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 30, 2024
Copy link
Contributor

gardener-prow bot commented Jul 5, 2024

PR needs rebase.

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-sigs/prow repository.

@gardener-ci-robot
Copy link
Contributor

The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:

  • After 15d of inactivity, lifecycle/stale is applied
  • After 15d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 7d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten

/close

@gardener-prow gardener-prow bot closed this Jul 12, 2024
Copy link
Contributor

gardener-prow bot commented Jul 12, 2024

@gardener-ci-robot: Closed this PR.

In response to this:

The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:

  • After 15d of inactivity, lifecycle/stale is applied
  • After 15d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 7d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten

/close

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-sigs/prow repository.

@tobiscr tobiscr deleted the extract-seed-determiner branch November 25, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/control-plane Control plane related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants