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

Ceph: Ability to enable pg_autoscaler mgr module via CRD #3769

Merged
merged 1 commit into from Sep 6, 2019

Conversation

leseb
Copy link
Member

@leseb leseb commented Sep 4, 2019

Description of your changes:
We can now enable via the CRD any manager module, to do this simply do
the following:

mgr:
  modules:
  - name: pg_autoscaler
    enabled: true

Which issue is resolved by this Pull Request:
Resolves #560

Checklist:

  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.
  • Comments have been added or updated based on the standards set in CONTRIBUTING.md
  • Add the flag for skipping the CI if this PR does not require a build. See here for more details.

// known CI issue
[skip ci]

@leseb leseb requested a review from travisn September 4, 2019 15:06
@leseb leseb force-pushed the mgr-modules branch 2 times, most recently from dc596b9 to 1e37209 Compare September 4, 2019 16:07
cluster/examples/kubernetes/ceph/cluster.yaml Outdated Show resolved Hide resolved
pkg/operator/ceph/cluster/mgr/mgr.go Outdated Show resolved Hide resolved
Copy link
Member

@travisn travisn left a 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...

tests/framework/installer/ceph_manifests_v1.0.go Outdated Show resolved Hide resolved
// 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")
Copy link
Member

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.

Copy link
Member

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.

@BlaineEXE
Copy link
Member

BlaineEXE commented Sep 4, 2019

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.

@BlaineEXE BlaineEXE added ceph main ceph tag configuration crd Changes related to a custom resource definition ceph-mgr Relating to the Ceph mgr or mgr modules labels Sep 4, 2019
Copy link
Member

@travisn travisn left a 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.

// 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")
Copy link
Member

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.

@travisn travisn changed the title ceph: ability to enable mgr module via CRD Ceph: Ability to enable pg_autoscaler mgr module via CRD Sep 5, 2019
@BlaineEXE BlaineEXE added this to the 1.2 milestone Sep 5, 2019
@travisn travisn force-pushed the mgr-modules branch 2 times, most recently from 432ec82 to 9478bad Compare September 5, 2019 23:33
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
Copy link
Member

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.

// 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")
Copy link
Member

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.

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)
Copy link
Member

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.

}
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)
Copy link
Member

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 Show resolved Hide resolved
assert.Equal(t, 0, len(configSettings))
}

func TestWellKnownModule(t *testing.T) {
Copy link
Member

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.

tests/framework/installer/ceph_manifests.go Show resolved Hide resolved
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ceph main ceph tag ceph-mgr Relating to the Ceph mgr or mgr modules configuration crd Changes related to a custom resource definition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Placement Group Management
3 participants