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

Fix json tags for etcd worker config #5151

Merged
merged 2 commits into from
Dec 13, 2021

Conversation

timuthy
Copy link
Contributor

@timuthy timuthy commented Dec 10, 2021

How to categorize this PR?

/area control-plane
/kind api-change
/needs cherry-pick

What this PR does / why we need it:
This PR amends the struct tags for workers configuration in the etcdConfig.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
This is an incompatible API change. However, the example as well as chart values assume that the fields were called workers before, so the likelihood to break someone is rather small. From an end-user perspective setting the values "just" didn't work.

Release note:

An issue has been fixed that prevented etcd worker counts from being set correctly in the `GardenletConfiguration`.

@timuthy timuthy requested a review from a team as a code owner December 10, 2021 15:10
@gardener-robot gardener-robot added area/control-plane Control plane related kind/api-change API change with impact on API users needs/cherry-pick size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 10, 2021
Copy link
Member

@ialidzhikov ialidzhikov left a comment

Choose a reason for hiding this comment

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

lgtm for the tag name change, but I have comments for discrepancies in the defaults.

@@ -515,23 +515,23 @@ type ETCDController struct {
// Workers specify number of worker threads in ETCD controller
// Defaults to 3
Copy link
Member

Choose a reason for hiding this comment

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

Not strictly related to this change but I think there is something wrong with the defaults:

if config.ETCDController != nil {
command = append(command, "--workers="+strconv.FormatInt(pointer.Int64Deref(config.ETCDController.Workers, 50), 10))
}
.

I don't see any explicit defaulting in g/g for this field. There is only defaulting to 50 when ETCDController is non-nil and Workers is nil. Does the default 3 actually comes from etcd-druid? If yes, doesn't it make sense to update the above handling to use 3 instead of 50?

Copy link
Contributor Author

@timuthy timuthy Dec 13, 2021

Choose a reason for hiding this comment

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

Good point.

There is only defaulting to 50 when ETCDController is non-nil and Workers is nil.

This is actually the default that is meant here. We should add it to the defaulting logic in pkg/gardenlet/apis/config/v1alpha1/defaults.go which was missed in the previous PR. I propose to do this in a future PR, @abdasgupta can take over when he returned.

If yes, doesn't it make sense to update the above handling to use 3 instead of 50?

50 was the hard-coded default earlier and if we now set it to 3 it will break operators who rely on the higher value. Therefore, 50 was chosen here. I will update the comment.

Copy link
Member

Choose a reason for hiding this comment

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

This is actually the default that is meant here. We should add it to the defaulting logic in pkg/gardenlet/apis/config/v1alpha1/defaults.go which was missed in the previous PR. I propose to do this in a future PR, @abdasgupta can take over when he returned.

Can you open an issue about it? There are still some discrepancies - it you don't specify any default config, then for the custodian controller 3 will be used (default in etcd-druid). But if you specify empty custodianController config, then 10 will be used (default in the etcd component in gardener). Let's better follow-up with separate issue - PR.

pkg/gardenlet/apis/config/v1alpha1/types.go Outdated Show resolved Hide resolved
Copy link
Member

@ialidzhikov ialidzhikov left a comment

Choose a reason for hiding this comment

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

/lgtm
/squash

@rfranzke rfranzke merged commit d30e555 into gardener:master Dec 13, 2021
timebertt pushed a commit that referenced this pull request Dec 13, 2021
…d worker config (#5155)

* Fix json tags for etcd worker config

* Rectify ETCDConfig comments
krgostev pushed a commit to krgostev/gardener that referenced this pull request Apr 21, 2022
* Fix json tags for etcd worker config

* Rectify ETCDConfig comments
krgostev pushed a commit to krgostev/gardener that referenced this pull request Jul 5, 2022
* Fix json tags for etcd worker config

* Rectify ETCDConfig comments
@timuthy timuthy deleted the fix.etcd-config-values branch December 23, 2022 07:39
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 kind/api-change API change with impact on API users size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants