-
Notifications
You must be signed in to change notification settings - Fork 25
CLOUDP-235689: Unify multi-cluster replica sets feature branch #569
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
base: master
Are you sure you want to change the base?
Conversation
MCK 1.6.0 Release NotesNew Features
Bug Fixes
Other Changes
|
Fix dns Update updateOmDeploymentRs OM registration helpers Update CRDs Todo and throw error Lint Add new scaling test + mock OM connection Add helpers Add scale up to test Extract common getReplicaSetProcessIdsFromReplicaSets read_statefulsets for MongoDB (pytest) Simplify tests Unit tests for state Improve comments, usage of state, replicate agent keys New constants Switch test order Some small e2e Multi cluster tests Naive scaler initialize cluster list
| // For StatefulSet pods, DNS format is: <pod-name>.<headless-service>.<namespace>.svc.<domain> | ||
| podName := GetMultiPodName(stsName, clusterNum, podNum) | ||
| headlessService := GetMultiHeadlessServiceName(stsName, clusterNum) | ||
| return fmt.Sprintf("%s.%s.%s.svc.%s", podName, headlessService, namespace, domain) |
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 think this breaks a lot of things (e.g. AppDB, exsiting MongoDBMultiCluster). Looking into this.
| // GetExternalDomainForMemberCluster returns the external domain for a specific member cluster. Falls back to the global | ||
| // external domain if not found. | ||
| func (m *MongoDbSpec) GetExternalDomainForMemberCluster(clusterName string) *string { | ||
| if cfg := m.ClusterSpecList.GetExternalAccessConfigurationForMemberCluster(clusterName); cfg != nil { |
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.
| if cfg := m.ClusterSpecList.GetExternalAccessConfigurationForMemberCluster(clusterName); cfg != nil { | |
| if cfg := m.GetExternalAccessConfigurationForMemberCluster(clusterName) { |
I think this should like so ^ (note call on the MongoDbSpec struct m, not on the cluster spec list m.ClusterSpecList) and GetExternalAccessConfigurationForMemberCluster should be something like:
func (m *MongoDbSpec) GetExternalAccessConfigurationForMemberCluster(clusterName string) *ExternalAccessConfiguration {
for _, csl := range m.ClusterSpecList {
if csl.ClusterName == clusterName && csl.ExternalAccessConfiguration != nil {
return csl.ExternalAccessConfiguration
}
}
return m.ExternalAccessConfiguration
}
Multi-Cluster Replica Set Support in MongoDB CRD
CLOUDP-235689 - unifying single-cluster and multi-cluster replica set configuration into the MongoDB CRD.
Context
Currently, users must choose between two CRDs:
MongoDB(type: ReplicaSet) - for single-cluster deploymentsMongoDBMultiCluster- for multi-cluster deploymentsThis creates UX confusion, code duplication, and migration barriers. Sharded clusters already solved this with a
topologyfield. This PR applies the same pattern to replica sets.Summary
Extends the MongoDB CRD to support multi-cluster replica sets via
topology: MultiCluster. Core functionality:Implementation follows the helper pattern from sharded cluster controller. State is persisted in annotations (will migrate to ConfigMap later).
Demo: Multi-Cluster Replica Set in Action
Deploying a replica set across 3 Kubernetes clusters with a single MongoDB resource:
After reconciliation:
Pods running across all 3 clusters:
Next steps
Bug:
Code cleanup:
Missing robustness features:
Incomplete validations:
State storage:
Limited test coverage:
Related tickets (for Jira to link them)
CLOUDP-353893, CLOUDP-353896, CLOUDP-353897
Testing
One new E2E test
e2e_multi_cluster_new_replica_set_scale_upwas added to assert we can deploy a replica set and reach Running.New unit test file:
mongodbreplicaset_controller_multi_test.goChecklist
skip-changeloglabel if not needed