diff --git a/README.md b/README.md index 16052645..35bd18a2 100644 --- a/README.md +++ b/README.md @@ -93,8 +93,8 @@ Please note this table only reports end-to-end tests suite coverage, others vers - [x] Cluster monitoring. - [x] Complete end2end test suite. - [x] Archival. +- [x] Multi cluster replication. - [ ] Auto scaling. -- [ ] Multi cluster replication. ## Contributing diff --git a/api/v1beta1/temporalcluster_types.go b/api/v1beta1/temporalcluster_types.go index 010aec4b..200b87f4 100644 --- a/api/v1beta1/temporalcluster_types.go +++ b/api/v1beta1/temporalcluster_types.go @@ -854,6 +854,20 @@ func (s *ClusterArchivalSpec) IsEnabled() bool { return s != nil && s.Enabled } +// ClusterReplicationSpec defines the specifications for replication in the temporal cluster. Using these +// the operator will configure the cluster to replicate data to other clusters. If this object is defined, +// then both properties below must be set. +type ClusterReplicationSpec struct { + // EnableGlobalNamespace signifies to this node that global namespaces should be enabled. + // Namespaces that are marked global are replicated across nodes in the cluster. + // +kubebuilder:validation:Required + EnableGlobalNamespace bool `json:"enableGlobalNamespace"` + // InitialFailoverVersion is used to determine the leadership order between nodes in the cluster. The node with the + // lowest initial failover version will be the primary. This must be unique across the cluster. + // +kubebuilder:validation:Required + InitialFailoverVersion int64 `json:"initialFailoverVersion"` +} + type ArchivalProviderKind string const ( @@ -1055,6 +1069,9 @@ type TemporalClusterSpec struct { // Authorization allows authorization configuration for the temporal cluster. // +optional Authorization *AuthorizationSpec `json:"authorization,omitempty"` + // Replication allows configuration of multi-cluster replication. + // +optional + Replication *ClusterReplicationSpec `json:"replication,omitempty"` } // ServiceStatus reports a service status. diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index d42b3b6c..4b65b7e6 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Licensed to Alexandre VILAIN under one or more contributor // license agreements. See the NOTICE file distributed with @@ -244,6 +243,21 @@ func (in *ClusterArchivalSpec) DeepCopy() *ClusterArchivalSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterReplicationSpec) DeepCopyInto(out *ClusterReplicationSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterReplicationSpec. +func (in *ClusterReplicationSpec) DeepCopy() *ClusterReplicationSpec { + if in == nil { + return nil + } + out := new(ClusterReplicationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConstrainedValue) DeepCopyInto(out *ConstrainedValue) { *out = *in @@ -431,7 +445,8 @@ func (in *DynamicConfigSpec) DeepCopyInto(out *DynamicConfigSpec) { if val == nil { (*out)[key] = nil } else { - in, out := &val, &outVal + inVal := (*in)[key] + in, out := &inVal, &outVal *out = make([]ConstrainedValue, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) @@ -641,7 +656,8 @@ func (in *MetricsSpec) DeepCopyInto(out *MetricsSpec) { if val == nil { (*out)[key] = nil } else { - in, out := &val, &outVal + inVal := (*in)[key] + in, out := &inVal, &outVal *out = make([]string, len(*in)) copy(*out, *in) } @@ -656,7 +672,8 @@ func (in *MetricsSpec) DeepCopyInto(out *MetricsSpec) { if val == nil { (*out)[key] = nil } else { - in, out := &val, &outVal + inVal := (*in)[key] + in, out := &inVal, &outVal *out = make([]string, len(*in)) copy(*out, *in) } @@ -1688,6 +1705,11 @@ func (in *TemporalClusterSpec) DeepCopyInto(out *TemporalClusterSpec) { *out = new(AuthorizationSpec) (*in).DeepCopyInto(*out) } + if in.Replication != nil { + in, out := &in.Replication, &out.Replication + *out = new(ClusterReplicationSpec) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemporalClusterSpec. diff --git a/bundle/manifests/temporal.io_temporalclusters.yaml b/bundle/manifests/temporal.io_temporalclusters.yaml index 9c9baf2f..34f8092f 100644 --- a/bundle/manifests/temporal.io_temporalclusters.yaml +++ b/bundle/manifests/temporal.io_temporalclusters.yaml @@ -2941,6 +2941,17 @@ spec: - defaultStore - visibilityStore type: object + replication: + properties: + enableGlobalNamespace: + type: boolean + initialFailoverVersion: + format: int64 + type: integer + required: + - enableGlobalNamespace + - initialFailoverVersion + type: object services: description: Services allows customizations for each temporal services deployment. diff --git a/config/crd/bases/temporal.io_temporalclusters.yaml b/config/crd/bases/temporal.io_temporalclusters.yaml index d14fc287..84bbeaaa 100644 --- a/config/crd/bases/temporal.io_temporalclusters.yaml +++ b/config/crd/bases/temporal.io_temporalclusters.yaml @@ -2692,6 +2692,24 @@ spec: - defaultStore - visibilityStore type: object + replication: + description: Replication allows configuration of multi-cluster replication. + properties: + enableGlobalNamespace: + description: |- + EnableGlobalNamespace signifies to this node that global namespaces should be enabled. + Namespaces that are marked global are replicated across nodes in the cluster. + type: boolean + initialFailoverVersion: + description: |- + InitialFailoverVersion is used to determine the leadership order between nodes in the cluster. The node with the + lowest initial failover version will be the primary. This must be unique across the cluster. + format: int64 + type: integer + required: + - enableGlobalNamespace + - initialFailoverVersion + type: object services: description: Services allows customizations for each temporal services deployment. properties: diff --git a/docs/api/v1beta1.md b/docs/api/v1beta1.md index 50822bd3..022277fa 100644 --- a/docs/api/v1beta1.md +++ b/docs/api/v1beta1.md @@ -294,6 +294,20 @@ AuthorizationSpec
Authorization allows authorization configuration for the temporal cluster.
+replication
Replication allows configuration of multi-cluster replication.
++(Appears on: +TemporalClusterSpec) +
+ClusterReplicationSpec defines the specifications for replication in the temporal cluster. Using these +the operator will configure the cluster to replicate data to other clusters. If this object is defined, +then both properties below must be set.
+Field | +Description | +
---|---|
+enableGlobalNamespace + +bool + + |
+
+ EnableGlobalNamespace signifies to this node that global namespaces should be enabled. +Namespaces that are marked global are replicated across nodes in the cluster. + |
+
+initialFailoverVersion + +int64 + + |
+
+ InitialFailoverVersion is used to determine the leadership order between nodes in the cluster. The node with the +lowest initial failover version will be the primary. This must be unique across the cluster. + |
+
@@ -5005,6 +5066,20 @@ AuthorizationSpec
Authorization allows authorization configuration for the temporal cluster.
+replication
Replication allows configuration of multi-cluster replication.
+