Skip to content

Commit 5f19434

Browse files
mayurcrewaleMayur Rewale
andauthored
[PLDPS-89]Temporal version 1-22-1 (#57)
* Temporal workflow * upgrade temporal to 1.22.1 * update format * removed dublicate values * corrected helm template format * removed codeowners --------- Co-authored-by: Mayur Rewale <[email protected]>
1 parent 958f577 commit 5f19434

File tree

7 files changed

+177
-20
lines changed

7 files changed

+177
-20
lines changed

charts/temporal/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ type: application
4949

5050
# This is the chart version. This version number should be incremented each time you make changes
5151
# to the chart and its templates, including the app version.
52-
version: 0.24.1
5352

53+
version: 0.29.0
5454
# This is the version number of the application being deployed. This version number should be
5555
# incremented each time you make changes to the application.
56-
appVersion: 1.21.1
56+
appVersion: 1.22.1

charts/temporal/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,17 @@ Source: https://stackoverflow.com/a/52024583/3027614
206206
{{- print "password" -}}
207207
{{- end -}}
208208

209+
{{- define "temporal.persistence.sql.database" -}}
210+
{{- $global := index . 0 -}}
211+
{{- $store := index . 1 -}}
212+
{{- $storeConfig := index $global.Values.server.config.persistence $store -}}
213+
{{- if $storeConfig.sql.database -}}
214+
{{- $storeConfig.sql.database -}}
215+
{{- else -}}
216+
{{- required (printf "Please specify database for %s store" $store) -}}
217+
{{- end -}}
218+
{{- end -}}
219+
209220
{{- define "temporal.persistence.sql.driver" -}}
210221
{{- $global := index . 0 -}}
211222
{{- $store := index . 1 -}}

charts/temporal/templates/server-configmap.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ data:
3939
{{- toYaml . | nindent 12 }}
4040
{{- end }}
4141
{{- end }}
42-
{{- if $.Values.server.config.persistence.faultinjection}}
43-
{{- if $.Values.server.config.persistence.faultinjection.rate }}
42+
{{- with $.Values.server.config.persistence.default.faultInjection}}
4443
faultInjection:
45-
rate: {{ $.Values.server.config.persistence.faultinjection.rate }}
46-
{{- end }}
44+
{{- toYaml . | nindent 12 }}
4745
{{- end }}
4846
{{- if eq (include "temporal.persistence.driver" (list $ "default")) "sql" }}
4947
sql:
@@ -122,6 +120,13 @@ data:
122120
listenAddress: "0.0.0.0:9090"
123121
{{- end }}
124122
123+
{{- if $.Values.server.config.tls }}
124+
tls:
125+
{{- with $.Values.server.config.tls }}
126+
{{- toYaml . | nindent 10 }}
127+
{{- end }}
128+
{{- end }}
129+
125130
services:
126131
frontend:
127132
rpc:

charts/temporal/templates/server-job.yaml

Lines changed: 91 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ spec:
5555
- name: create-{{ $store }}-store
5656
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
5757
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
58-
command: ['sh', '-c', 'temporal-cassandra-tool create -k {{ $storeConfig.cassandra.keyspace }} --replication-factor {{ $storeConfig.cassandra.replicationFactor }}']
58+
command: ['temporal-cassandra-tool', 'create', '-k', '{{ $storeConfig.cassandra.keyspace }}', '--replication-factor', '{{ $storeConfig.cassandra.replicationFactor }}']
5959
env:
6060
- name: CASSANDRA_HOST
6161
value: {{ first (splitList "," (include "temporal.persistence.cassandra.hosts" (list $ $store))) }}
@@ -80,6 +80,38 @@ spec:
8080
{{- end }}
8181
{{- end }}
8282
{{- end }}
83+
{{- else if or (eq (include "temporal.persistence.driver" (list $ "default")) "sql") (eq (include "temporal.persistence.driver" (list $ "visibility")) "sql") }}
84+
{{- range $store := (list "default" "visibility") }}
85+
{{- $storeConfig := index $.Values.server.config.persistence $store }}
86+
{{- if eq (include "temporal.persistence.driver" (list $ $store)) "sql" }}
87+
- name: create-{{ $store }}-store
88+
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
89+
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
90+
command: ['temporal-sql-tool', '--database', '{{ include "temporal.persistence.sql.database" (list $ $store) }}', 'create-database']
91+
env:
92+
- name: SQL_PLUGIN
93+
value: {{ include "temporal.persistence.sql.driver" (list $ $store) }}
94+
- name: SQL_HOST
95+
value: {{ include "temporal.persistence.sql.host" (list $ $store) }}
96+
- name: SQL_PORT
97+
value: {{ include "temporal.persistence.sql.port" (list $ $store) | quote }}
98+
{{- if $storeConfig.sql.user }}
99+
- name: SQL_USER
100+
value: {{ $storeConfig.sql.user }}
101+
{{- end }}
102+
{{- if (or $storeConfig.sql.password $storeConfig.sql.existingSecret) }}
103+
- name: SQL_PASSWORD
104+
{{- if $storeConfig.sql.existingSecret }}
105+
valueFrom:
106+
secretKeyRef:
107+
name: {{ include "temporal.persistence.secretName" (list $ $store) }}
108+
key: {{ include "temporal.persistence.secretKey" (list $ $store) }}
109+
{{- else }}
110+
value: {{ $storeConfig.sql.password }}
111+
{{- end }}
112+
{{- end }}
113+
{{- end }}
114+
{{- end }}
83115
{{- else }}
84116
[]
85117
{{- end }}
@@ -89,7 +121,7 @@ spec:
89121
- name: {{ $store }}-schema
90122
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
91123
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
92-
command: ["temporal-{{ include "temporal.persistence.driver" (list $ $store) }}-tool", "setup-schema", "-v", "0.0"]
124+
command: ['temporal-{{ include "temporal.persistence.driver" (list $ $store) }}-tool', 'setup-schema', '-v', '0.0']
93125
env:
94126
{{- if eq (include "temporal.persistence.driver" (list $ $store)) "cassandra" }}
95127
- name: CASSANDRA_HOST
@@ -113,6 +145,30 @@ spec:
113145
value: {{ $storeConfig.cassandra.password }}
114146
{{- end }}
115147
{{- end }}
148+
{{- else if eq (include "temporal.persistence.driver" (list $ $store)) "sql" }}
149+
- name: SQL_PLUGIN
150+
value: {{ include "temporal.persistence.sql.driver" (list $ $store) }}
151+
- name: SQL_HOST
152+
value: {{ include "temporal.persistence.sql.host" (list $ $store) }}
153+
- name: SQL_PORT
154+
value: {{ include "temporal.persistence.sql.port" (list $ $store) | quote }}
155+
- name: SQL_DATABASE
156+
value: {{ include "temporal.persistence.sql.database" (list $ $store) }}
157+
{{- if $storeConfig.sql.user }}
158+
- name: SQL_USER
159+
value: {{ $storeConfig.sql.user }}
160+
{{- end }}
161+
{{- if (or $storeConfig.sql.password $storeConfig.sql.existingSecret) }}
162+
- name: SQL_PASSWORD
163+
{{- if $storeConfig.sql.existingSecret }}
164+
valueFrom:
165+
secretKeyRef:
166+
name: {{ include "temporal.persistence.secretName" (list $ $store) }}
167+
key: {{ include "temporal.persistence.secretKey" (list $ $store) }}
168+
{{- else }}
169+
value: {{ $storeConfig.sql.password }}
170+
{{- end }}
171+
{{- end }}
116172
{{- end }}
117173
{{- end }}
118174
{{- with .Values.schema.resources }}
@@ -203,7 +259,15 @@ spec:
203259
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
204260
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
205261
{{- if eq (include "temporal.persistence.driver" (list $ $store)) "cassandra" }}
206-
command: ['sh', '-c', 'temporal-cassandra-tool update-schema -d /etc/temporal/schema/cassandra/{{ include "temporal.persistence.schema" $store }}/versioned']
262+
command: ['temporal-{{ include "temporal.persistence.driver" (list $ $store) }}-tool', 'update-schema', '--schema-dir', '/etc/temporal/schema/cassandra/{{ include "temporal.persistence.schema" $store }}/versioned']
263+
{{- else if eq (include "temporal.persistence.sql.driver" (list $ $store)) "mysql" }}
264+
command: ['temporal-{{ include "temporal.persistence.driver" (list $ $store) }}-tool', 'update-schema', '--schema-dir', '/etc/temporal/schema/mysql/v57/{{ include "temporal.persistence.schema" $store }}/versioned']
265+
{{- else if eq (include "temporal.persistence.sql.driver" (list $ $store)) "mysql8" }}
266+
command: ['temporal-{{ include "temporal.persistence.driver" (list $ $store) }}-tool', 'update-schema', '--schema-dir', '/etc/temporal/schema/mysql/v8/{{ include "temporal.persistence.schema" $store }}/versioned']
267+
{{- else if eq (include "temporal.persistence.sql.driver" (list $ $store)) "postgres" }}
268+
command: ['temporal-{{ include "temporal.persistence.driver" (list $ $store) }}-tool', 'update-schema', '--schema-dir', '/etc/temporal/schema/postgresql/v96/{{ include "temporal.persistence.schema" $store }}/versioned']
269+
{{- else if eq (include "temporal.persistence.sql.driver" (list $ $store)) "postgres12" }}
270+
command: ['temporal-{{ include "temporal.persistence.driver" (list $ $store) }}-tool', 'update-schema', '--schema-dir', '/etc/temporal/schema/postgresql/v12/{{ include "temporal.persistence.schema" $store }}/versioned']
207271
{{- end }}
208272
env:
209273
{{- if eq (include "temporal.persistence.driver" (list $ $store)) "cassandra" }}
@@ -228,6 +292,30 @@ spec:
228292
value: {{ $storeConfig.cassandra.password }}
229293
{{- end }}
230294
{{- end }}
295+
{{- else if eq (include "temporal.persistence.driver" (list $ $store)) "sql" }}
296+
- name: SQL_PLUGIN
297+
value: {{ include "temporal.persistence.sql.driver" (list $ $store) }}
298+
- name: SQL_HOST
299+
value: {{ include "temporal.persistence.sql.host" (list $ $store) }}
300+
- name: SQL_PORT
301+
value: {{ include "temporal.persistence.sql.port" (list $ $store) | quote }}
302+
- name: SQL_DATABASE
303+
value: {{ include "temporal.persistence.sql.database" (list $ $store) }}
304+
{{- if $storeConfig.sql.user }}
305+
- name: SQL_USER
306+
value: {{ $storeConfig.sql.user }}
307+
{{- end }}
308+
{{- if (or $storeConfig.sql.password $storeConfig.sql.existingSecret) }}
309+
- name: SQL_PASSWORD
310+
{{- if $storeConfig.sql.existingSecret }}
311+
valueFrom:
312+
secretKeyRef:
313+
name: {{ include "temporal.persistence.secretName" (list $ $store) }}
314+
key: {{ include "temporal.persistence.secretKey" (list $ $store) }}
315+
{{- else }}
316+
value: {{ $storeConfig.sql.password }}
317+
{{- end }}
318+
{{- end }}
231319
{{- end }}
232320
{{- end }}
233321
{{- with .Values.schema.resources }}

charts/temporal/templates/web-deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ spec:
4141
- name: {{ .Chart.Name }}-web-config
4242
configMap:
4343
name: {{ include "temporal.componentname" (list . "web") }}-config
44+
{{- if .Values.web.additionalVolumes }}
45+
{{- toYaml .Values.web.additionalVolumes | nindent 8 }}
46+
{{- end }}
4447
containers:
4548
- name: {{ .Chart.Name }}-web
4649
image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag }}"
@@ -61,6 +64,10 @@ spec:
6164
securityContext:
6265
{{- toYaml . | nindent 12 }}
6366
{{- end }}
67+
{{- with .Values.web.additionalVolumeMounts }}
68+
volumeMounts:
69+
{{- toYaml . | nindent 12 }}
70+
{{- end }}
6471
{{- with .Values.web.securityContext }}
6572
securityContext:
6673
{{- toYaml . | nindent 8 }}

charts/temporal/values.yaml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ server:
2121
sidecarContainers: {}
2222
image:
2323
repository: temporalio/server
24-
tag: 1.21.1
24+
tag: 1.22.1
2525
pullPolicy: IfNotPresent
2626

2727
# Global default settings (can be overridden per service)
@@ -94,6 +94,35 @@ server:
9494
# IMPORTANT: This value cannot be changed, once it's set.
9595
numHistoryShards: 512
9696

97+
# Define your TLS configuration here. See https://docs.temporal.io/references/configuration#tls
98+
# for configuration options. You must also use `server.additionalVolumeMounts` and `server.additionalVolumes`
99+
# to mount certificates (from Secret or ConfigMap etc) to the path you use below.
100+
# tls:
101+
# internode:
102+
# server:
103+
# certFile: /path/to/internode/cert/file
104+
# keyFile: /path/to/internode/key/file
105+
# requireClientAuth: true
106+
# clientCaFiles:
107+
# - /path/to/internode/serverCa
108+
# client:
109+
# serverName: dnsSanInInternodeCertificate
110+
# rootCaFiles:
111+
# - /path/to/internode/serverCa
112+
# frontend:
113+
# server:
114+
# certFile: /path/to/frontend/cert/file
115+
# keyFile: /path/to/frontend/key/file
116+
# requireClientAuth: true
117+
# clientCaFiles:
118+
# - /path/to/internode/serverCa
119+
# - /path/to/sdkClientPool1/ca
120+
# - /path/to/sdkClientPool2/ca
121+
# client:
122+
# serverName: dnsSanInFrontendCertificate
123+
# rootCaFiles:
124+
# - /path/to/frontend/serverCa
125+
97126
persistence:
98127
defaultStore: default
99128
additionalStores: {}
@@ -257,7 +286,7 @@ admintools:
257286
enabled: true
258287
image:
259288
repository: temporalio/admin-tools
260-
tag: 1.21.1
289+
tag: 1.22.1
261290
pullPolicy: IfNotPresent
262291

263292
service:
@@ -301,18 +330,14 @@ web:
301330
# loadBalancerIP:
302331

303332
ingress:
304-
enabled: true
305-
className: alb
333+
enabled: false
334+
# className:
306335
annotations: {}
307-
kubernetes.io/ingress.class: traefik
308-
# ingress.kubernetes.io/ssl-redirect: "true"
336+
# kubernetes.io/ingress.class: traefik
337+
# ingress.kubernetes.io/ssl-redirect: "false"
309338
# traefik.frontend.rule.type: PathPrefix
310-
# alb.ingress.kubernetes.io/scheme: "internet-facing" │
311-
# # # │alb.ingress.kubernetes.io/security-groups: "sg-042081a1c69c1d8be" │
312-
# alb.ingress.kubernetes.io/success-codes: "200"
313-
314339
hosts:
315-
- "csw.integration.opengov.zone"
340+
- "/"
316341
# - "domain.com/xyz"
317342
# - "domain.com"
318343
tls: []
@@ -341,6 +366,9 @@ web:
341366

342367
affinity: {}
343368

369+
additionalVolumes: []
370+
additionalVolumeMounts: []
371+
344372
additionalEnv: []
345373

346374
containerSecurityContext: {}

charts/temporal/values/values.cassandra.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ server:
88
default:
99
driver: "cassandra"
1010

11+
# faultInjection:
12+
# targets:
13+
# dataStores:
14+
# ExecutionStore:
15+
# methods:
16+
# GetCurrentExecution:
17+
# errors:
18+
# ResourceExhausted: 0.1
19+
# AppendHistoryNodes:
20+
# errors:
21+
# ResourceExhausted: 0.05
22+
# UpdateWorkflowExecution:
23+
# errors:
24+
# ResourceExhausted: 0.15
25+
# GetWorkflowExecution:
26+
# errors:
27+
# ResourceExhausted: 0.15
28+
1129
cassandra:
1230
hosts: ["cassandra.default.svc.cluster.local"]
1331
port: 9042

0 commit comments

Comments
 (0)