Skip to content

Commit fe63497

Browse files
committed
new parameter argocd: true for helm/argo annotations,
jobs from init containers are located separately
1 parent 4133132 commit fe63497

File tree

5 files changed

+93
-39
lines changed

5 files changed

+93
-39
lines changed

charts/synapse/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
22
name: synapse
3-
version: 0.28.5
3+
version: 0.29.0

charts/synapse/templates/matrix-authentication-deployment.yaml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,44 +27,6 @@ spec:
2727
{{- end }}
2828
spec:
2929
terminationGracePeriodSeconds: 60
30-
initContainers:
31-
- name: database-migrate
32-
image: {{ .Values.matrixAuthentication.image.repository }}:{{ .Values.matrixAuthentication.image.tag }}
33-
imagePullPolicy: {{ .Values.matrixAuthentication.image.pullPolicy }}
34-
env:
35-
- name: "MAS_CONFIG"
36-
value: "/etc/mas-config.yaml"
37-
command:
38-
- /usr/local/bin/mas-cli
39-
- database
40-
- migrate
41-
resources:
42-
{{- toYaml .Values.matrixAuthentication.resources | nindent 12 }}
43-
volumeMounts:
44-
- name: config
45-
mountPath: "/etc/mas-config.yaml"
46-
subPath: "mas-config.yaml"
47-
readOnly: true
48-
- name: config-sync
49-
image: {{ .Values.matrixAuthentication.image.repository }}:{{ .Values.matrixAuthentication.image.tag }}
50-
imagePullPolicy: {{ .Values.matrixAuthentication.image.pullPolicy }}
51-
env:
52-
- name: "MAS_CONFIG"
53-
value: "/etc/mas-config.yaml"
54-
command:
55-
- /usr/local/bin/mas-cli
56-
- config
57-
- sync
58-
{{- if .Values.matrixAuthentication.configSyncPrune }}
59-
- --prune
60-
{{- end }}
61-
resources:
62-
{{- toYaml .Values.matrixAuthentication.resources | nindent 12 }}
63-
volumeMounts:
64-
- name: config
65-
mountPath: "/etc/mas-config.yaml"
66-
subPath: "mas-config.yaml"
67-
readOnly: true
6830
containers:
6931
- name: main
7032
image: {{ .Values.matrixAuthentication.image.repository }}:{{ .Values.matrixAuthentication.image.tag }}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{{- if .Values.matrixAuthentication.enabled }}
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: matrix-authentication-config-sync
6+
annotations:
7+
{{- if .Values.argocd }}
8+
argocd.argoproj.io/sync-wave: "-10"
9+
argocd.argoproj.io/hook: "Sync"
10+
{{- else }}
11+
helm.sh/hook: "pre-install,pre-upgrade"
12+
helm.sh/hook-weight: "-10"
13+
{{- end }}
14+
spec:
15+
parallelism: 1
16+
completions: 1
17+
template:
18+
spec:
19+
restartPolicy: Never
20+
containers:
21+
- name: config-sync
22+
image: {{ .Values.matrixAuthentication.image.repository }}:{{ .Values.matrixAuthentication.image.tag }}
23+
imagePullPolicy: {{ .Values.matrixAuthentication.image.pullPolicy }}
24+
env:
25+
- name: "MAS_CONFIG"
26+
value: "/etc/mas-config.yaml"
27+
command:
28+
- /usr/local/bin/mas-cli
29+
- config
30+
- sync
31+
{{- if .Values.matrixAuthentication.configSyncPrune }}
32+
- --prune
33+
{{- end }}
34+
volumeMounts:
35+
- name: config
36+
mountPath: "/etc/mas-config.yaml"
37+
subPath: "mas-config.yaml"
38+
readOnly: true
39+
volumes:
40+
- name: config
41+
secret:
42+
secretName: matrix-authentication
43+
items:
44+
- key: mas-config.yaml
45+
path: mas-config.yaml
46+
{{- end }}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{{- if .Values.matrixAuthentication.enabled }}
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: matrix-authentication-db-migration
6+
annotations:
7+
{{- if .Values.argocd }}
8+
argocd.argoproj.io/sync-wave: "-20"
9+
argocd.argoproj.io/hook: "Sync"
10+
{{- else }}
11+
helm.sh/hook: "pre-install,pre-upgrade"
12+
helm.sh/hook-weight: "-20"
13+
{{- end }}
14+
spec:
15+
parallelism: 1
16+
completions: 1
17+
template:
18+
spec:
19+
restartPolicy: Never
20+
containers:
21+
- name: db-migration
22+
image: {{ .Values.matrixAuthentication.image.repository }}:{{ .Values.matrixAuthentication.image.tag }}
23+
imagePullPolicy: {{ .Values.matrixAuthentication.image.pullPolicy }}
24+
env:
25+
- name: "MAS_CONFIG"
26+
value: "/etc/mas-config.yaml"
27+
command:
28+
- /usr/local/bin/mas-cli
29+
- database
30+
- migrate
31+
volumeMounts:
32+
- name: config
33+
mountPath: "/etc/mas-config.yaml"
34+
subPath: "mas-config.yaml"
35+
readOnly: true
36+
volumes:
37+
- name: config
38+
secret:
39+
secretName: matrix-authentication
40+
items:
41+
- key: mas-config.yaml
42+
path: mas-config.yaml
43+
{{- end }}

charts/synapse/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,3 +606,6 @@ resourceQuota:
606606
livekitServer:
607607
ingress:
608608
host: ''
609+
610+
# switch between helm (helm.sh/hook) and argo (argocd.argoproj.io/sync-wave) anotations
611+
argocd: true

0 commit comments

Comments
 (0)