Skip to content

Commit

Permalink
mgr: remove remaining pg_autoscaler examples
Browse files Browse the repository at this point in the history
The pg_autoscaler is always enabled by ceph and cannot be disabled.
In rook#13588 the pg_autoscaler config was removed from the main example.
Now the remaining config for the pg_autoscaler is removed as well.

Signed-off-by: travisn <tnielsen@redhat.com>
  • Loading branch information
travisn committed Feb 13, 2024
1 parent 69b8b34 commit 9552dc9
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 55 deletions.
8 changes: 4 additions & 4 deletions deploy/charts/rook-ceph-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ cephClusterSpec:
count: 2
allowMultiplePerNode: false
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.
- name: pg_autoscaler
enabled: true
# List of modules to optionally enable or disable.
# Note the "dashboard" and "monitoring" modules are already configured by other settings in the cluster CR.
# - name: rook
# enabled: true

# enable the ceph dashboard for viewing cluster status
dashboard:
Expand Down
3 changes: 0 additions & 3 deletions deploy/examples/cluster-on-local-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ spec:
continueUpgradeAfterChecksEvenIfNotHealthy: false
mgr:
count: 1
modules:
- name: pg_autoscaler
enabled: true
dashboard:
enabled: true
ssl: true
Expand Down
3 changes: 0 additions & 3 deletions deploy/examples/cluster-on-pvc-minikube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ spec:
storage: 10Gi
mgr:
count: 1
modules:
- name: pg_autoscaler
enabled: true
dashboard:
enabled: true
ssl: false
Expand Down
6 changes: 2 additions & 4 deletions deploy/examples/cluster-on-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ spec:
skipUpgradeChecks: false
continueUpgradeAfterChecksEvenIfNotHealthy: false
mgr:
count: 1
modules:
- name: pg_autoscaler
enabled: true
count: 2
allowMultiplePerNode: false
dashboard:
enabled: true
ssl: true
Expand Down
31 changes: 12 additions & 19 deletions pkg/operator/ceph/cluster/mgr/mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,18 @@ import (
var logger = capnslog.NewPackageLogger("github.com/rook/rook", "op-mgr")

const (
AppName = "rook-ceph-mgr"
serviceAccountName = "rook-ceph-mgr"
PrometheusModuleName = "prometheus"
crashModuleName = "crash"
PgautoscalerModuleName = "pg_autoscaler"
balancerModuleName = "balancer"
balancerModuleMode = "upmap"
mgrRoleLabelName = "mgr_role"
activeMgrStatus = "active"
standbyMgrStatus = "standby"
monitoringPath = "/etc/ceph-monitoring/"
serviceMonitorFile = "service-monitor.yaml"
serviceMonitorPort = "http-metrics"
AppName = "rook-ceph-mgr"
serviceAccountName = "rook-ceph-mgr"
PrometheusModuleName = "prometheus"
crashModuleName = "crash"
balancerModuleName = "balancer"
balancerModuleMode = "upmap"
mgrRoleLabelName = "mgr_role"
activeMgrStatus = "active"
standbyMgrStatus = "standby"
monitoringPath = "/etc/ceph-monitoring/"
serviceMonitorFile = "service-monitor.yaml"
serviceMonitorPort = "http-metrics"
// minimum amount of memory in MB to run the pod
cephMgrPodMinimumMemory uint64 = 512
// DefaultMetricsPort prometheus exporter port
Expand Down Expand Up @@ -494,12 +493,6 @@ func (c *Cluster) configureMgrModules() error {

// Configure special settings for individual modules that are enabled
switch module.Name {
case PgautoscalerModuleName:
monStore := config.GetMonStore(c.context, c.clusterInfo)
err := monStore.Set("global", "mon_pg_warn_min_per_osd", "0")
if err != nil {
return errors.Wrap(err, "failed to set minimal number PGs per (in) osd before we warn the admin to")
}
case rookModuleName:
startModuleConfiguration("orchestrator modules", c.configureOrchestratorModules)
}
Expand Down
20 changes: 1 addition & 19 deletions pkg/operator/ceph/cluster/mgr/mgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,24 +333,6 @@ func TestConfigureModules(t *testing.T) {
assert.Equal(t, 0, modulesDisabled)
assert.Equal(t, "mymodule", lastModuleConfigured)

// one module that has a min version that is not met
c.spec.Mgr.Modules = []cephv1.Module{
{Name: "pg_autoscaler", Enabled: true},
}

// one module that has a min version that is met
c.spec.Mgr.Modules = []cephv1.Module{
{Name: "pg_autoscaler", Enabled: true},
}
c.clusterInfo.CephVersion = cephver.CephVersion{Major: 15}
modulesEnabled = 0
assert.NoError(t, c.configureMgrModules())
assert.Equal(t, 1, modulesEnabled)
assert.Equal(t, 0, modulesDisabled)
assert.Equal(t, "pg_autoscaler", lastModuleConfigured)
assert.Equal(t, 1, len(configSettings))
assert.Equal(t, "0", configSettings["mon_pg_warn_min_per_osd"])

// disable the module
modulesEnabled = 0
lastModuleConfigured = ""
Expand All @@ -359,7 +341,7 @@ func TestConfigureModules(t *testing.T) {
assert.NoError(t, c.configureMgrModules())
assert.Equal(t, 0, modulesEnabled)
assert.Equal(t, 1, modulesDisabled)
assert.Equal(t, "pg_autoscaler", lastModuleConfigured)
assert.Equal(t, "mymodule", lastModuleConfigured)
assert.Equal(t, 0, len(configSettings))
}

Expand Down
3 changes: 0 additions & 3 deletions tests/framework/installer/ceph_manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ spec:
mgr:
count: ` + strconv.Itoa(mgrCount) + `
allowMultiplePerNode: true
modules:
- name: pg_autoscaler
enabled: true
dashboard:
enabled: true
network:
Expand Down

0 comments on commit 9552dc9

Please sign in to comment.