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

Make seed lease/duration configurable #5092

Merged
merged 5 commits into from
Dec 9, 2021

Conversation

ary1992
Copy link
Contributor

@ary1992 ary1992 commented Nov 30, 2021

How to categorize this PR?

/area scalability
/kind enhancement

What this PR does / why we need it:
Make seed lease/duration period configurable.
Which issue(s) this PR fixes:
Fixes #4504

Special notes for your reviewer:

Release note:

Two fields `LeaseDurationSeconds` and `LeaseResyncSeconds` added under `SeedControllerConfiguration` to make Seed lease and duration configurable. Both field have default value of 2 seconds.

@ary1992 ary1992 requested review from a team as code owners November 30, 2021 06:07
@gardener-robot gardener-robot added area/scalability Scalability related kind/enhancement Enhancement, improvement, extension labels Nov 30, 2021
@gardener-robot
Copy link

@ary1992 Thank you for your contribution.

@gardener-robot gardener-robot added needs/review size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 30, 2021
@gardener-robot-ci-1
Copy link
Contributor

Thank you @ary1992 for your contribution. Before I can start building your PR, a member of the organization must set the required label(s) {'reviewed/ok-to-test'}. Once started, you can check the build status in the PR checks section below.

@ary1992
Copy link
Contributor Author

ary1992 commented Nov 30, 2021

/invite @shafeeqes @acumino

@BeckerMax
Copy link
Contributor

/reviewed/ok-to-test

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.

Generally, I'm wondering: Do we really need these two new fields or would one (used at both occurrences) be enough? Are there use-cases for which I'd like the .spec.leaseDurationSeconds value in the Lease object to be different compared to the duration how of the lease is renewed? Or wouldn't this rather be always equal?

pkg/gardenlet/apis/config/types.go Outdated Show resolved Hide resolved
pkg/gardenlet/apis/config/types.go Outdated Show resolved Hide resolved
pkg/gardenlet/apis/config/types.go Outdated Show resolved Hide resolved
pkg/gardenlet/apis/config/types.go Outdated Show resolved Hide resolved
pkg/gardenlet/apis/config/v1alpha1/types.go Outdated Show resolved Hide resolved
pkg/gardenlet/apis/config/v1alpha1/types.go Outdated Show resolved Hide resolved
pkg/gardenlet/apis/config/v1alpha1/types.go Outdated Show resolved Hide resolved
pkg/gardenlet/controller/seed/lease_control.go Outdated Show resolved Hide resolved
@rfranzke
Copy link
Member

Can you add a proper release note to make operators aware that this is now configurable?
Can you also extend https://github.com/gardener/gardener/blob/master/example/20-componentconfig-gardenlet.yaml and https://github.com/gardener/gardener/tree/master/charts/gardener/gardenlet accordingly, please?

@gardener-robot
Copy link

@acumino You have pull request review open invite, please check

@rfranzke
Copy link
Member

rfranzke commented Dec 3, 2021

@ary1992 The verify step is failing, can you check please?

@rfranzke
Copy link
Member

rfranzke commented Dec 3, 2021

09a0e66 looks good, thank you! Please proceed with the other improvements as discussed yesterday :)

@ary1992
Copy link
Contributor Author

ary1992 commented Dec 3, 2021

lue in the Lease object to be different compared to the duration how of the lease is renewed? Or wouldn't this rather be always equal?

Earlier two separate fields were defined as constant integer LeaseDurationSeconds and LeaseResyncSeconds. Hence two separate int variables are defined with the same name corresponding to constant integer under SeedControllerConfiguration as mentioned in issue #4504 . Moreover LeaseResyncGracePeriodSeconds was defined in terms of LeaseResyncSeconds i.e LeaseResyncGracePeriodSeconds = LeaseResyncSeconds * 10. If we can define LeaseResyncGracePeriodSeconds in terms of LeaseDurationSeconds, then one variable is enough. Need more insight on such use cases where only LeaseDurationSeconds is enough rather that two separate variables.

@rfranzke
Copy link
Member

rfranzke commented Dec 3, 2021

Need more insight on such use cases where only LeaseDurationSeconds is enough rather that two separate variables.

I would rather say the opposite: We need to know about use cases where only one configuration value is NOT enough.
@timebertt Since you originally opened the issue - do you have information about such use cases?

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.

Thanks @ary1992, apart from the naming suggestion it looks good. I think we should go ahead with merging the two fields LeaseResyncSeconds and LeaseDurationSeconds since nobody speaks up with a justifying use-case.

pkg/gardenlet/apis/config/types.go Outdated Show resolved Hide resolved
@ary1992
Copy link
Contributor Author

ary1992 commented Dec 7, 2021

/merge squash

@gardener-robot
Copy link

@ary1992 You are not permitted to touch label merge/squash.

@BeckerMax
Copy link
Contributor

/merge squash

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.

It looks good, apart from the failing test I have no further comments.

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

@rfranzke rfranzke merged commit b7b736c into gardener:master Dec 9, 2021
krgostev pushed a commit to krgostev/gardener that referenced this pull request Apr 21, 2022
* make seed lease/duration period configurable

* Move the configuration fields to  SeedControllerConfiguration

* Make LeaseResyncGracePeriod configurable

* Merge two fields LeaseResyncSeconds and LeaseDurationSeconds into one field LeaseResyncSeconds.

* Make changes to unit test
krgostev pushed a commit to krgostev/gardener that referenced this pull request Jul 5, 2022
* make seed lease/duration period configurable

* Move the configuration fields to  SeedControllerConfiguration

* Make LeaseResyncGracePeriod configurable

* Merge two fields LeaseResyncSeconds and LeaseDurationSeconds into one field LeaseResyncSeconds.

* Make changes to unit test
@ary1992 ary1992 deleted the enh/seed-lease branch January 23, 2023 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/scalability Scalability related kind/enhancement Enhancement, improvement, extension size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[good first issue] Make Seed lease sync/duration period configurable
9 participants