blob: e400d338ca0edd1e87861ea351852e6e99a8e731 [file] [log] [blame]
giolekva95340e82021-11-08 21:36:55 +04001apiVersion: rbac.authorization.k8s.io/v1
2kind: Role
3metadata:
4 name: CreateConfigMaps
5 namespace: {{ .Release.Namespace }}
giolekva30850462021-12-01 16:23:50 +04006 annotations:
7 helm.sh/hook: pre-install
8 helm.sh/hook-weight: "-10"
giolekva95340e82021-11-08 21:36:55 +04009rules:
10- apiGroups:
11 - ""
12 resources:
13 - configmaps
14 verbs:
15 - get
16 - create
17---
18apiVersion: rbac.authorization.k8s.io/v1
19kind: RoleBinding
20metadata:
21 name: default-CreateConfigMaps
22 namespace: {{ .Release.Namespace }}
giolekva30850462021-12-01 16:23:50 +040023 annotations:
24 helm.sh/hook: pre-install
25 helm.sh/hook-weight: "-10"
giolekva95340e82021-11-08 21:36:55 +040026roleRef:
27 apiGroup: rbac.authorization.k8s.io
28 kind: Role
29 name: CreateConfigMaps
30subjects:
31- kind: ServiceAccount
32 name: default
33 namespace: {{ .Release.Namespace }}
34---
35apiVersion: v1
36kind: Service
37metadata:
38 name: matrix
39 namespace: {{ .Release.Namespace }}
40spec:
41 type: ClusterIP
42 selector:
43 app: matrix
44 ports:
45 - name: http
46 port: 80
47 targetPort: http
48 protocol: TCP
49---
giolekva30850462021-12-01 16:23:50 +040050apiVersion: cert-manager.io/v1
51kind: Certificate
52metadata:
53 name: matrix.{{ .Values.domain }}
54 namespace: {{ .Release.Namespace }}
55 annotations:
56 helm.sh/resource-policy: keep
57spec:
58 dnsNames:
59 - 'matrix.{{ .Values.domain }}'
60 issuerRef:
61 name: {{ .Values.certificateIssuer }}
62 kind: ClusterIssuer
63 secretName: cert-matrix.{{ .Values.domain }}
64---
giolekva95340e82021-11-08 21:36:55 +040065apiVersion: networking.k8s.io/v1
66kind: Ingress
67metadata:
68 name: ingress
69 namespace: {{ .Release.Namespace }}
giolekva95340e82021-11-08 21:36:55 +040070spec:
71 ingressClassName: {{ .Values.ingressClassName }}
72 tls:
73 - hosts:
74 - matrix.{{ .Values.domain }}
giolekva11881b52021-11-27 16:51:58 +040075 secretName: cert-matrix.{{ .Values.domain }}
giolekva95340e82021-11-08 21:36:55 +040076 rules:
77 - host: matrix.{{ .Values.domain }}
78 http:
79 paths:
80 - path: /
81 pathType: Prefix
82 backend:
83 service:
84 name: matrix
85 port:
86 name: http
87---
88apiVersion: batch/v1
89kind: Job
90metadata:
91 name: generate-config
92 namespace: {{ .Release.Namespace }}
giolekva30850462021-12-01 16:23:50 +040093 annotations:
94 helm.sh/hook: pre-install
95 helm.sh/hook-weight: "-5"
giolekva95340e82021-11-08 21:36:55 +040096spec:
97 template:
98 metadata:
99 labels:
100 app: generate-config
101 spec:
102 restartPolicy: OnFailure
103 volumes:
104 - name: data
105 persistentVolumeClaim:
106 claimName: data
107 initContainers:
108 - name: matrix
109 image: matrixdotorg/synapse:v1.43.0
110 imagePullPolicy: IfNotPresent
111 ports:
112 - name: http
113 containerPort: 8008
114 protocol: TCP
115 env:
116 - name: SYNAPSE_SERVER_NAME
117 value: "{{ .Values.domain }}"
118 - name: SYNAPSE_REPORT_STATS
119 value: "no"
120 - name: SYNAPSE_CONFIG_DIR
121 value: "/data"
122 - name: SYNAPSE_CONFIG_PATH
123 value: "/data/homeserver.yaml"
124 - name: SYNAPSE_DATA_DIR
125 value: "/data"
126 command:
127 - /start.py
128 - generate
129 volumeMounts:
130 - name: data
131 mountPath: /data
132 containers:
133 - name: capture-config
134 image: giolekva/capture-config:latest
135 imagePullPolicy: Always
136 command:
137 - capture-config
138 - --config=/data/homeserver.yaml
139 - --namespace={{ .Release.Namespace }}
140 - --config-map-name=config
141 - --config-to-merge={{ .Values.configMerge.configName }}
142 - --to-merge-filename={{ .Values.configMerge.fileName }}
143 volumeMounts:
144 - name: data
145 mountPath: /data
146---
147apiVersion: apps/v1
148kind: Deployment
149metadata:
150 name: matrix
151 namespace: {{ .Release.Namespace }}
152spec:
153 selector:
154 matchLabels:
155 app: matrix
156 replicas: 1
157 template:
158 metadata:
159 labels:
160 app: matrix
161 spec:
162 volumes:
163 - name: data
164 persistentVolumeClaim:
165 claimName: data
166 - name: homeserver-config
167 configMap:
168 name: config
169 containers:
170 - name: matrix
171 image: matrixdotorg/synapse:v1.43.0
172 imagePullPolicy: IfNotPresent
173 ports:
174 - name: http
175 containerPort: 8008
176 protocol: TCP
177 env:
178 - name: SYNAPSE_SERVER_NAME
179 value: "{{ .Values.domain }}"
180 - name: SYNAPSE_REPORT_STATS
181 value: "no"
182 - name: SYNAPSE_CONFIG_DIR
183 value: "/data"
184 - name: SYNAPSE_CONFIG_PATH
185 value: "/homeserver-config/homeserver.yaml"
186 - name: SYNAPSE_DATA_DIR
187 value: "/data"
188 command: ["/start.py"]
189 volumeMounts:
190 - name: data
191 mountPath: /data
192 - name: homeserver-config
193 mountPath: /homeserver-config
194 readOnly: true
195---
196apiVersion: v1
197kind: PersistentVolumeClaim
198metadata:
199 name: data
200 namespace: {{ .Release.Namespace }}
giolekva30850462021-12-01 16:23:50 +0400201 annotations:
202 helm.sh/hook: pre-install
203 helm.sh/hook-weight: "-10"
giolekva95340e82021-11-08 21:36:55 +0400204spec:
205 accessModes:
206 - ReadWriteOnce
207 resources:
208 requests:
209 storage: 10Gi