From 2f431935064d0f4f4cca49f0fcd8c2f18bb96aac Mon Sep 17 00:00:00 2001 From: wxing1292 Date: Wed, 9 Dec 2020 09:40:00 -0800 Subject: [PATCH] Add NDC config (#114) --- templates/_helpers.tpl | 49 +++++++++++++++++++++++++++------ templates/server-configmap.yaml | 7 +++++ values/values.ndc.yaml | 34 +++++++++++++++++++++++ 3 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 values/values.ndc.yaml diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index feadef73..e4bcf73c 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -54,36 +54,67 @@ Source: https://stackoverflow.com/a/52024583/3027614 {{- end }} {{- define "temporal.frontend.grpcPort" -}} -7233 +{{- if $.Values.server.frontend.service.port -}} +{{- $.Values.server.frontend.service.port -}} +{{- else -}} +{{- 7233 -}} +{{- end -}} {{- end -}} {{- define "temporal.frontend.membershipPort" -}} -6933 +{{- if $.Values.server.frontend.service.membershipPort -}} +{{- $.Values.server.frontend.service.membershipPort -}} +{{- else -}} +{{- 6933 -}} +{{- end -}} {{- end -}} - {{- define "temporal.history.grpcPort" -}} -7234 +{{- if $.Values.server.history.service.port -}} +{{- $.Values.server.history.service.port -}} +{{- else -}} +{{- 7234 -}} +{{- end -}} {{- end -}} {{- define "temporal.history.membershipPort" -}} -6934 +{{- if $.Values.server.history.service.membershipPort -}} +{{- $.Values.server.history.service.membershipPort -}} +{{- else -}} +{{- 6934 -}} +{{- end -}} {{- end -}} {{- define "temporal.matching.grpcPort" -}} -7235 +{{- if $.Values.server.matching.service.port -}} +{{- $.Values.server.matching.service.port -}} +{{- else -}} +{{- 7235 -}} +{{- end -}} {{- end -}} {{- define "temporal.matching.membershipPort" -}} -6935 +{{- if $.Values.server.matching.service.membershipPort -}} +{{- $.Values.server.matching.service.membershipPort -}} +{{- else -}} +{{- 6935 -}} +{{- end -}} {{- end -}} {{- define "temporal.worker.grpcPort" -}} -7239 +{{- if $.Values.server.worker.service.port -}} +{{- $.Values.server.worker.service.port -}} +{{- else -}} +{{- 7239 -}} +{{- end -}} {{- end -}} {{- define "temporal.worker.membershipPort" -}} -6939 +{{- if $.Values.server.worker.service.membershipPort -}} +{{- $.Values.server.worker.service.membershipPort -}} +{{- else -}} +{{- 6939 -}} +{{- end -}} {{- end -}} {{- define "temporal.persistence.schema" -}} diff --git a/templates/server-configmap.yaml b/templates/server-configmap.yaml index 4e8f8b2f..67a4b53b 100644 --- a/templates/server-configmap.yaml +++ b/templates/server-configmap.yaml @@ -161,6 +161,12 @@ data: dlq-topic: temporal-visibility-dev-dlq {{- end }} + {{- if $.Values.server.config.clusterMetadata }} + clusterMetadata: + {{- with .Values.server.config.clusterMetadata }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- else }} clusterMetadata: enableGlobalDomain: false failoverVersionIncrement: 10 @@ -172,6 +178,7 @@ data: initialFailoverVersion: 1 rpcName: "temporal-frontend" rpcAddress: "127.0.0.1:7933" + {{- end }} dcRedirectionPolicy: policy: "noop" diff --git a/values/values.ndc.yaml b/values/values.ndc.yaml new file mode 100644 index 00000000..70d6758e --- /dev/null +++ b/values/values.ndc.yaml @@ -0,0 +1,34 @@ +server: + config: + dcRedirectionPolicy: + policy: "selected-apis-forwarding" + toDC: "" + + clusterMetadata: + enableGlobalNamespace: true + replicationConsumer: + type: rpc + failoverVersionIncrement: 100 + masterClusterName: cluster_a + currentClusterName: # + # clusterInformation: + # : + # enabled: true + # initialFailoverVersion: + # rpcName: "frontend" + # rpcAddress: + # cluster_a: + # enabled: true + # initialFailoverVersion: 1 + # rpcName: "frontend" + # rpcAddress: "localhost:7233" + # cluster_b: + # enabled: true + # initialFailoverVersion: 2 + # rpcName: "frontend" + # rpcAddress: "localhost:8233" + # cluster_c: + # enabled: false + # initialFailoverVersion: 3 + # rpcName: "frontend" + # rpcAddress: "localhost:9233"