diff --git a/charts/temporal/templates/admintools-deployment.yaml b/charts/temporal/templates/admintools-deployment.yaml index f84a8655..271ac3b4 100644 --- a/charts/temporal/templates/admintools-deployment.yaml +++ b/charts/temporal/templates/admintools-deployment.yaml @@ -33,9 +33,17 @@ spec: env: # TEMPORAL_CLI_ADDRESS is deprecated, use TEMPORAL_ADDRESS instead - name: TEMPORAL_CLI_ADDRESS + {{- if index $.Values.server "internal-frontend" "enabled" }} + value: {{ include "temporal.fullname" $ }}-internal-frontend:{{ index $.Values.server "internal-frontend" "service" "port" }} + {{- else }} value: {{ include "temporal.fullname" $ }}-frontend:{{ .Values.server.frontend.service.port }} + {{- end }} - name: TEMPORAL_ADDRESS + {{- if index $.Values.server "internal-frontend" "enabled" }} + value: {{ include "temporal.fullname" $ }}-internal-frontend:{{ index $.Values.server "internal-frontend" "service" "port" }} + {{- else }} value: {{ include "temporal.fullname" $ }}-frontend:{{ .Values.server.frontend.service.port }} + {{- end }} {{- if .Values.admintools.additionalEnv }} {{- toYaml .Values.admintools.additionalEnv | nindent 12 }} {{- end }} diff --git a/charts/temporal/templates/server-configmap.yaml b/charts/temporal/templates/server-configmap.yaml index 0de45347..3e24c19e 100644 --- a/charts/temporal/templates/server-configmap.yaml +++ b/charts/temporal/templates/server-configmap.yaml @@ -119,6 +119,15 @@ data: membershipPort: {{ $server.frontend.service.membershipPort }} bindOnIP: "0.0.0.0" + {{- if index $.Values.server "internal-frontend" "enabled" }} + internal-frontend: + rpc: + grpcPort: {{ index $server "internal-frontend" "service" "port" }} + httpPort: {{ index $server "internal-frontend" "service" "httpPort" }} + membershipPort: {{ index $server "internal-frontend" "service" "membershipPort" }} + bindOnIP: "0.0.0.0" + {{- end }} + history: rpc: grpcPort: {{ $server.history.service.port }} @@ -173,8 +182,10 @@ data: {{- toYaml . | nindent 6 }} {{- end }} + {{- if not (index $.Values.server "internal-frontend" "enabled") }} publicClient: hostPort: "{{ include "temporal.componentname" (list $ "frontend") }}:{{ $server.frontend.service.port }}" + {{- end }} dynamicConfigClient: filepath: "/etc/temporal/dynamic_config/dynamic_config.yaml" diff --git a/charts/temporal/templates/server-deployment.yaml b/charts/temporal/templates/server-deployment.yaml index 798a4cb0..7cbb321a 100644 --- a/charts/temporal/templates/server-deployment.yaml +++ b/charts/temporal/templates/server-deployment.yaml @@ -1,6 +1,7 @@ {{- if $.Values.server.enabled }} -{{- range $service := (list "frontend" "history" "matching" "worker") }} +{{- range $service := (list "frontend" "internal-frontend" "history" "matching" "worker") }} {{ $serviceValues := index $.Values.server $service }} +{{- if or (not (hasKey $serviceValues "enabled")) $serviceValues.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -81,6 +82,10 @@ spec: secretKeyRef: name: {{ include "temporal.persistence.secretName" (list $ "visibility") }} key: {{ include "temporal.persistence.secretKey" (list $ "visibility") }} + {{- if index $.Values.server "internal-frontend" "enabled" }} + - name: USE_INTERNAL_FRONTEND + value: "1" + {{- end }} {{- if $.Values.server.versionCheckDisabled }} - name: TEMPORAL_VERSION_CHECK_DISABLED value: "1" @@ -94,7 +99,7 @@ spec: containerPort: {{ $serviceValues.service.port }} protocol: TCP {{- end }} - {{- if eq $service "frontend" }} + {{- if or (eq $service "frontend") (eq $service "internal-frontend") }} - name: http containerPort: {{ $serviceValues.service.httpPort }} protocol: TCP @@ -162,3 +167,4 @@ spec: --- {{- end }} {{- end }} +{{- end }} diff --git a/charts/temporal/templates/server-job.yaml b/charts/temporal/templates/server-job.yaml index e1aec9c1..096082dc 100644 --- a/charts/temporal/templates/server-job.yaml +++ b/charts/temporal/templates/server-job.yaml @@ -142,7 +142,11 @@ spec: args: ['temporal operator namespace describe -n {{ $namespace.name }} || temporal operator namespace create -n {{ $namespace.name }}{{- if hasKey $namespace "retention" }} --retention {{ $namespace.retention }}{{- end }}'] env: - name: TEMPORAL_ADDRESS + {{- if index $.Values.server "internal-frontend" "enabled" }} + value: {{ include "temporal.fullname" $ }}-internal-frontend.{{ $.Release.Namespace }}.svc:{{ index $.Values.server "internal-frontend" "service" "port" }} + {{- else }} value: "{{ include "temporal.fullname" $ }}-frontend.{{ $.Release.Namespace }}.svc:{{ $.Values.server.frontend.service.port }}" + {{- end }} {{- with $.Values.server.additionalVolumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/charts/temporal/templates/server-pdb.yaml b/charts/temporal/templates/server-pdb.yaml index 29667a06..fbd10c36 100644 --- a/charts/temporal/templates/server-pdb.yaml +++ b/charts/temporal/templates/server-pdb.yaml @@ -1,6 +1,7 @@ {{- if $.Values.server.enabled }} -{{- range $service := (list "frontend" "history" "matching" "worker") }} +{{- range $service := (list "frontend" "internal-frontend" "history" "matching" "worker") }} {{- $serviceValues := index $.Values.server $service -}} +{{- if or (not (hasKey $serviceValues "enabled")) $serviceValues.enabled }} {{- if and (gt ($serviceValues.replicaCount | int) 1) ($serviceValues.podDisruptionBudget) }} apiVersion: policy/v1 kind: PodDisruptionBudget @@ -19,3 +20,4 @@ spec: --- {{- end }} {{- end }} +{{- end }} diff --git a/charts/temporal/templates/server-service-monitor.yaml b/charts/temporal/templates/server-service-monitor.yaml index d5aedb94..b953117e 100644 --- a/charts/temporal/templates/server-service-monitor.yaml +++ b/charts/temporal/templates/server-service-monitor.yaml @@ -1,6 +1,7 @@ {{- if $.Values.server.enabled }} -{{- range $service := (list "frontend" "matching" "history" "worker") }} +{{- range $service := (list "frontend" "internal-frontend" "matching" "history" "worker") }} {{- $serviceValues := index $.Values.server $service -}} +{{- if or (not (hasKey $serviceValues "enabled")) $serviceValues.enabled }} {{- if (default $.Values.server.metrics.serviceMonitor.enabled $serviceValues.metrics.serviceMonitor.enabled) }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -33,3 +34,4 @@ spec: {{- end }} {{- end }} {{- end }} +{{- end }} diff --git a/charts/temporal/templates/server-service.yaml b/charts/temporal/templates/server-service.yaml index 47e4d0bf..2cc8a9b1 100644 --- a/charts/temporal/templates/server-service.yaml +++ b/charts/temporal/templates/server-service.yaml @@ -29,8 +29,41 @@ spec: app.kubernetes.io/component: frontend --- -{{- range $service := (list "frontend" "matching" "history" "worker") }} +{{- if index $.Values.server "internal-frontend" "enabled" }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "temporal.componentname" (list $ "internal-frontend") }} + labels: + {{- include "temporal.resourceLabels" (list $ "internal-frontend" "") | nindent 4 }} + {{- if hasKey (index .Values.server "internal-frontend" "service") "annotations" }} + annotations: {{- include "common.tplvalues.render" ( dict "value" (index .Values.server "internal-frontend" "service" "annotations") "context" $) | nindent 4 }} + {{- end }} +spec: + type: {{ index .Values.server "internal-frontend" "service" "type" }} + ports: + - port: {{ index .Values.server "internal-frontend" "service" "port" }} + targetPort: rpc + protocol: TCP + name: grpc-rpc + {{- if hasKey (index .Values.server "internal-frontend" "service") "nodePort" }} + nodePort: {{ index .Values.server "internal-frontend" "service" "nodePort" }} + {{- end }} + - port: {{ index .Values.server "internal-frontend" "service" "httpPort" }} + targetPort: http + protocol: TCP + name: http + # TODO: Allow customizing the node HTTP port + selector: + app.kubernetes.io/name: {{ include "temporal.name" $ }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: internal-frontend + +--- +{{- end }} +{{- range $service := (list "frontend" "internal-frontend" "matching" "history" "worker") }} {{ $serviceValues := index $.Values.server $service }} +{{- if or (not (hasKey $serviceValues "enabled")) $serviceValues.enabled }} apiVersion: v1 kind: Service metadata: @@ -70,3 +103,4 @@ spec: --- {{- end }} {{- end }} +{{- end }} diff --git a/charts/temporal/values.yaml b/charts/temporal/values.yaml index a5f35944..700cd34f 100644 --- a/charts/temporal/values.yaml +++ b/charts/temporal/values.yaml @@ -242,6 +242,35 @@ server: containerSecurityContext: {} topologySpreadConstraints: [] podDisruptionBudget: {} + internal-frontend: + # Enable this to create internal-frontend + enabled: false + service: + # Evaluated as template + annotations: {} + type: ClusterIP + port: 7233 + membershipPort: 6933 + httpPort: 7243 + metrics: + annotations: + enabled: true + serviceMonitor: {} + # enabled: false + prometheus: {} + # timerType: histogram + deploymentLabels: {} + deploymentAnnotations: {} + podAnnotations: {} + podLabels: {} + resources: {} + nodeSelector: {} + tolerations: [] + affinity: {} + additionalEnv: [] + containerSecurityContext: {} + topologySpreadConstraints: [] + podDisruptionBudget: {} history: service: # type: ClusterIP