diff --git a/controllers/storagecluster/cephcluster.go b/controllers/storagecluster/cephcluster.go index 03e931a0c9..2495c339c1 100644 --- a/controllers/storagecluster/cephcluster.go +++ b/controllers/storagecluster/cephcluster.go @@ -73,6 +73,7 @@ const ( clusterNetworkSelectorKey = "cluster" // DisasterRecoveryTargetAnnotation signifies that the cluster is intended to be used for Disaster Recovery DisasterRecoveryTargetAnnotation = "ocs.openshift.io/clusterIsDisasterRecoveryTarget" + upmapReadBalancerMode = "upmap-read" ) const ( @@ -1101,7 +1102,7 @@ func generateMgrSpec(sc *ocsv1.StorageCluster) rookCephv1.MgrSpec { AllowMultiplePerNode: statusutil.IsSingleNodeDeployment(), Modules: []rookCephv1.Module{ {Name: "pg_autoscaler", Enabled: true}, - {Name: "balancer", Enabled: true}, + {Name: "balancer", Enabled: true, Settings: rookCephv1.ModuleSettings{BalancerMode: upmapReadBalancerMode}}, }, } diff --git a/controllers/storagecluster/cephcluster_test.go b/controllers/storagecluster/cephcluster_test.go index a8919da11f..74c059625c 100644 --- a/controllers/storagecluster/cephcluster_test.go +++ b/controllers/storagecluster/cephcluster_test.go @@ -305,7 +305,7 @@ func TestGenerateMgrSpec(t *testing.T) { AllowMultiplePerNode: false, Modules: []rookCephv1.Module{ {Name: "pg_autoscaler", Enabled: true}, - {Name: "balancer", Enabled: true}, + {Name: "balancer", Enabled: true, Settings: rookCephv1.ModuleSettings{BalancerMode: upmapReadBalancerMode}}, }, }, }, @@ -325,7 +325,7 @@ func TestGenerateMgrSpec(t *testing.T) { AllowMultiplePerNode: false, Modules: []rookCephv1.Module{ {Name: "pg_autoscaler", Enabled: true}, - {Name: "balancer", Enabled: true}, + {Name: "balancer", Enabled: true, Settings: rookCephv1.ModuleSettings{BalancerMode: upmapReadBalancerMode}}, }, }, }, @@ -348,7 +348,7 @@ func TestGenerateMgrSpec(t *testing.T) { AllowMultiplePerNode: false, Modules: []rookCephv1.Module{ {Name: "pg_autoscaler", Enabled: true}, - {Name: "balancer", Enabled: true}, + {Name: "balancer", Enabled: true, Settings: rookCephv1.ModuleSettings{BalancerMode: upmapReadBalancerMode}}, }, }, }, @@ -361,7 +361,7 @@ func TestGenerateMgrSpec(t *testing.T) { AllowMultiplePerNode: true, Modules: []rookCephv1.Module{ {Name: "pg_autoscaler", Enabled: true}, - {Name: "balancer", Enabled: true}, + {Name: "balancer", Enabled: true, Settings: rookCephv1.ModuleSettings{BalancerMode: upmapReadBalancerMode}}, }, }, },