Skip to content

Commit

Permalink
Deploy 2 mgr daemons by default, one active and one standby.
Browse files Browse the repository at this point in the history
This significantly improves the reliability, and eliminates the
possibility of a single point of failure for the mgr service.

Signed-off-by: Malay Kumar Parida <[email protected]>
  • Loading branch information
malayparida2000 committed Oct 17, 2023
1 parent 70f2156 commit 14cddf3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
1 change: 1 addition & 0 deletions api/v1/storagecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ type ManageCephRBDMirror struct {

// MgrSpec defines the settings for the Ceph Manager
type MgrSpec struct {
// +kubebuilder:deprecatedversion:warning="This field has been deprecated and will be removed in future versions. Active passive mgr is now enabled by default."
// EnableActivePassive can be set as true to deploy 2 ceph manager pods, one active and one standby
// Ceph will promote the standby mgr when the active mgr goes down due to any reason
EnableActivePassive bool `json:"enableActivePassive,omitempty"`
Expand Down
4 changes: 1 addition & 3 deletions controllers/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ const (

var (
// DefaultMgrCount is the default number of Ceph Manager Pods
DefaultMgrCount = 1
// ArbiterModeMgrCount is the number of Ceph Manager pods in arbiter mode
ArbiterModeMgrCount = 2
DefaultMgrCount = 2
// DefaultMonCount is the number of monitors to be configured for the CephCluster
DefaultMonCount = 3
// ArbiterModeMonCount is the number of monitors to be configured for the CephCluster in arbiter mode
Expand Down
12 changes: 3 additions & 9 deletions controllers/storagecluster/cephcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,7 @@ func getMinimumNodes(sc *ocsv1.StorageCluster) int {
return maxReplica
}

func getMgrCount(arbiterMode bool) int {
if arbiterMode {
return defaults.ArbiterModeMgrCount
}
func getMgrCount() int {
return defaults.DefaultMgrCount
}

Expand Down Expand Up @@ -1067,16 +1064,13 @@ func generateMonSpec(sc *ocsv1.StorageCluster, nodeCount int) rookCephv1.MonSpec

func generateMgrSpec(sc *ocsv1.StorageCluster) rookCephv1.MgrSpec {
spec := rookCephv1.MgrSpec{
Count: getMgrCount(arbiterEnabled(sc)),
Count: getMgrCount(),
AllowMultiplePerNode: statusutil.IsSingleNodeDeployment(),
Modules: []rookCephv1.Module{
{Name: "pg_autoscaler", Enabled: true},
{Name: "balancer", Enabled: true},
},
}
if sc.Spec.Mgr != nil && sc.Spec.Mgr.EnableActivePassive {
spec.Count = 2
spec.AllowMultiplePerNode = statusutil.IsSingleNodeDeployment()
}

return spec
}
Expand Down

0 comments on commit 14cddf3

Please sign in to comment.