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
Ceph: Ability to enable pg_autoscaler mgr module via CRD #3769
Conversation
dc596b9
to
1e37209
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, assuming the final test change and then we need the CI back up again...
pkg/operator/ceph/cluster/mgr/mgr.go
Outdated
// Ceph Octopus will have that option enabled | ||
if module.Name == "pg_autoscaler" && c.clusterInfo.CephVersion.IsAtLeastNautilus() { | ||
monStore := config.GetMonStore(context, clusterName) | ||
err := monStore.Set("global", "osd_pool_default_pg_autoscale_mode", "on") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will re-enable the autoscale module with every orchestration, even if the user has configured this to be off
. I thought we talked about how this would be a bad idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we discussed it would be a bad idea if we were always doing this. In this PR we are only doing this when pg_autoscaler
is in the list of modules to enable in the CR, the user should expect autoscaling to be enabled, right? If they don't want the autoscaler enabled, then they wouldn't add it to the CR.
This seems to be feature creep in our v1.1 release. We will struggle with our releases continuing to be delayed if we aren't resolute about refusing new features for a release after the feature freeze date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be feature creep in our v1.1 release.
Agreed that it is a very late feature. Enabling the autoscaler by default in the examples could be a risky change as well. How about if we comment out the pg_autoscaler in the example cluster.yaml by default? This way the new feature won't be a risk, while also making it simpler for the user to enable the autoscaler if they choose to do that instead of manage PGs.
pkg/operator/ceph/cluster/mgr/mgr.go
Outdated
// Ceph Octopus will have that option enabled | ||
if module.Name == "pg_autoscaler" && c.clusterInfo.CephVersion.IsAtLeastNautilus() { | ||
monStore := config.GetMonStore(context, clusterName) | ||
err := monStore.Set("global", "osd_pool_default_pg_autoscale_mode", "on") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we discussed it would be a bad idea if we were always doing this. In this PR we are only doing this when pg_autoscaler
is in the list of modules to enable in the CR, the user should expect autoscaling to be enabled, right? If they don't want the autoscaler enabled, then they wouldn't add it to the CR.
432ec82
to
9478bad
Compare
modules: | ||
# Several modules should not need to be included in this list. The "dashboard" and "monitoring" modules | ||
# are already enabled by other settings in the cluster CR and the "rook" module is always enabled. | ||
#- name: pg_autoscaler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need space between #
and -
and the below line should be spaced one more also to keep with the format used by most editors where commenting a block puts #
before lines as has been done for the description above.
pkg/operator/ceph/cluster/mgr/mgr.go
Outdated
// Enable mgr modules from the spec | ||
for _, module := range c.mgrSpec.Modules { | ||
if module.Name == "" { | ||
return fmt.Errorf("Name not specified for the mgr module configuration") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errors should not start with capitals.
pkg/operator/ceph/cluster/mgr/mgr.go
Outdated
return fmt.Errorf("Name not specified for the mgr module configuration") | ||
} | ||
if wellKnownModule(module.Name) { | ||
return fmt.Errorf("Cannot configure mgr module %s that is configured with other cluster settings", module.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errors should not start with capitals.
pkg/operator/ceph/cluster/mgr/mgr.go
Outdated
} | ||
minVersion, versionOK := c.moduleMeetsMinVersion(module.Name) | ||
if !versionOK { | ||
return fmt.Errorf("Module %s cannot be configured because it requires at least Ceph version %v", module.Name, minVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errors should not start with capitals.
assert.Equal(t, 0, len(configSettings)) | ||
} | ||
|
||
func TestWellKnownModule(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this test really adds value. It is effectively just testing the contents of the knownModules
slice in the wellKnownModule
function, and when well known modules are added in the future, it will be likely someone will miss that this test exists, bringing theout of sync with the function under test.
We can now enable via the cluster CR any manager module with a setting under the new mgr element mgr: modules: - name: pg_autoscaler enabled: true Co-authored-by: Sébastien Han <seb@redhat.com> Co-authored-by: travisn <tnielsen@redhat.com> Signed-off-by: travisn <tnielsen@redhat.com>
Description of your changes:
We can now enable via the CRD any manager module, to do this simply do
the following:
Which issue is resolved by this Pull Request:
Resolves #560
Checklist:
make codegen
) has been run to update object specifications, if necessary.// known CI issue
[skip ci]