Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/v1/mdb/mongodb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,13 @@ type DbCommonSpec struct {
// +kubebuilder:validation:Enum=SingleCluster;MultiCluster
// +optional
Topology string `json:"topology,omitempty"`

// ClusterSpecList defines the configuration for MongoDB instances across multiple Kubernetes clusters.
// This field is used when Topology is set to "MultiCluster" and specifies how MongoDB members
// are distributed across different clusters, including member counts, service configurations,
// and external access settings for each cluster.
// +optional
ClusterSpecList ClusterSpecList `json:"clusterSpecList,omitempty"`
}

type MongoDbSpec struct {
Expand Down
2 changes: 0 additions & 2 deletions api/v1/mdbmulti/mongodb_multi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ type MongoDBMultiSpec struct {
// +kubebuilder:pruning:PreserveUnknownFields
mdbv1.DbCommonSpec `json:",inline"`

ClusterSpecList mdbv1.ClusterSpecList `json:"clusterSpecList,omitempty"`

// Mapping stores the deterministic index for a given cluster-name.
Mapping map[string]int `json:"-"`
}
Expand Down
145 changes: 145 additions & 0 deletions config/crd/bases/mongodb.com_mongodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,151 @@ spec:
clusterDomain:
format: hostname
type: string
clusterSpecList:
description: |-
ClusterSpecList defines the configuration for MongoDB instances across multiple Kubernetes clusters.
This field is used when Topology is set to "MultiCluster" and specifies how MongoDB members
are distributed across different clusters, including member counts, service configurations,
and external access settings for each cluster.
items:
description: |-
ClusterSpecItem is the mongodb multi-cluster spec that is specific to a
particular Kubernetes cluster, this maps to the statefulset created in each cluster
properties:
clusterName:
description: |-
ClusterName is name of the cluster where the MongoDB Statefulset will be scheduled, the
name should have a one on one mapping with the service-account created in the central cluster
to talk to the workload clusters.
type: string
externalAccess:
description: ExternalAccessConfiguration provides external access
configuration for Multi-Cluster.
properties:
externalDomain:
description: An external domain that is used for exposing
MongoDB to the outside world.
type: string
externalService:
description: Provides a way to override the default (NodePort)
Service
properties:
annotations:
additionalProperties:
type: string
description: A map of annotations that shall be added
to the externally available Service.
type: object
spec:
description: A wrapper for the Service spec object.
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
type: object
memberConfig:
description: MemberConfig allows to specify votes, priorities
and tags for each of the mongodb process.
items:
properties:
priority:
type: string
tags:
additionalProperties:
type: string
type: object
votes:
type: integer
type: object
type: array
members:
description: Amount of members for this MongoDB Replica Set
type: integer
podSpec:
properties:
persistence:
description: Note, that this field is used by MongoDB resources
only, let's keep it here for simplicity
properties:
multiple:
properties:
data:
properties:
labelSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
storage:
type: string
storageClass:
type: string
type: object
journal:
properties:
labelSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
storage:
type: string
storageClass:
type: string
type: object
logs:
properties:
labelSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
storage:
type: string
storageClass:
type: string
type: object
type: object
single:
properties:
labelSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
storage:
type: string
storageClass:
type: string
type: object
type: object
podTemplate:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
service:
description: this is an optional service, it will get the name
"<rsName>-service" in case not provided
type: string
statefulSet:
description: |-
StatefulSetConfiguration holds the optional custom StatefulSet
that should be merged into the operator created one.
properties:
metadata:
description: StatefulSetMetadataWrapper is a wrapper around
Labels and Annotations
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- spec
type: object
required:
- members
type: object
type: array
configServerCount:
type: integer
configSrv:
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/mongodb.com_mongodbmulticluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ spec:
format: hostname
type: string
clusterSpecList:
description: |-
ClusterSpecList defines the configuration for MongoDB instances across multiple Kubernetes clusters.
This field is used when Topology is set to "MultiCluster" and specifies how MongoDB members
are distributed across different clusters, including member counts, service configurations,
and external access settings for each cluster.
items:
description: |-
ClusterSpecItem is the mongodb multi-cluster spec that is specific to a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ func getMultiClusterMongoDB() mdbmulti.MongoDBMultiCluster {
},
Roles: []mdb.MongoDBRole{},
},
},
ClusterSpecList: mdb.ClusterSpecList{
{
ClusterName: "foo",
Members: 3,
ClusterSpecList: mdb.ClusterSpecList{
{
ClusterName: "foo",
Members: 3,
},
},
},
}
Expand Down
145 changes: 145 additions & 0 deletions helm_chart/crds/mongodb.com_mongodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,151 @@ spec:
clusterDomain:
format: hostname
type: string
clusterSpecList:
description: |-
ClusterSpecList defines the configuration for MongoDB instances across multiple Kubernetes clusters.
This field is used when Topology is set to "MultiCluster" and specifies how MongoDB members
are distributed across different clusters, including member counts, service configurations,
and external access settings for each cluster.
items:
description: |-
ClusterSpecItem is the mongodb multi-cluster spec that is specific to a
particular Kubernetes cluster, this maps to the statefulset created in each cluster
properties:
clusterName:
description: |-
ClusterName is name of the cluster where the MongoDB Statefulset will be scheduled, the
name should have a one on one mapping with the service-account created in the central cluster
to talk to the workload clusters.
type: string
externalAccess:
description: ExternalAccessConfiguration provides external access
configuration for Multi-Cluster.
properties:
externalDomain:
description: An external domain that is used for exposing
MongoDB to the outside world.
type: string
externalService:
description: Provides a way to override the default (NodePort)
Service
properties:
annotations:
additionalProperties:
type: string
description: A map of annotations that shall be added
to the externally available Service.
type: object
spec:
description: A wrapper for the Service spec object.
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
type: object
memberConfig:
description: MemberConfig allows to specify votes, priorities
and tags for each of the mongodb process.
items:
properties:
priority:
type: string
tags:
additionalProperties:
type: string
type: object
votes:
type: integer
type: object
type: array
members:
description: Amount of members for this MongoDB Replica Set
type: integer
podSpec:
properties:
persistence:
description: Note, that this field is used by MongoDB resources
only, let's keep it here for simplicity
properties:
multiple:
properties:
data:
properties:
labelSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
storage:
type: string
storageClass:
type: string
type: object
journal:
properties:
labelSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
storage:
type: string
storageClass:
type: string
type: object
logs:
properties:
labelSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
storage:
type: string
storageClass:
type: string
type: object
type: object
single:
properties:
labelSelector:
type: object
x-kubernetes-preserve-unknown-fields: true
storage:
type: string
storageClass:
type: string
type: object
type: object
podTemplate:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
service:
description: this is an optional service, it will get the name
"<rsName>-service" in case not provided
type: string
statefulSet:
description: |-
StatefulSetConfiguration holds the optional custom StatefulSet
that should be merged into the operator created one.
properties:
metadata:
description: StatefulSetMetadataWrapper is a wrapper around
Labels and Annotations
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- spec
type: object
required:
- members
type: object
type: array
configServerCount:
type: integer
configSrv:
Expand Down
5 changes: 5 additions & 0 deletions helm_chart/crds/mongodb.com_mongodbmulticluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ spec:
format: hostname
type: string
clusterSpecList:
description: |-
ClusterSpecList defines the configuration for MongoDB instances across multiple Kubernetes clusters.
This field is used when Topology is set to "MultiCluster" and specifies how MongoDB members
are distributed across different clusters, including member counts, service configurations,
and external access settings for each cluster.
items:
description: |-
ClusterSpecItem is the mongodb multi-cluster spec that is specific to a
Expand Down
Loading
Loading