ungleich-k8s/apps/matrix/templates/synapse.yaml

119 lines
3.4 KiB
YAML
Raw Normal View History

2021-12-25 09:53:35 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-matrix-synapse
spec:
selector:
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: matrix-synapse
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: matrix-synapse
annotations:
checksum/config: {{ include (print $.Template.BasePath "/synapse-proxy.yaml") . | sha256sum }}
checksum/synapse: {{ include (print $.Template.BasePath "/synapse-conf.yaml") . | sha256sum }}
spec:
initContainers:
- name: generate-matrix-signing-key
image: matrixdotorg/synapse:{{ .Values.synapseVersion }}
command:
- "python"
- "-m"
- "synapse.app.homeserver"
- "--config-path"
- "/conf"
- "--keys-directory"
- "/data"
- "--generate-keys"
volumeMounts:
- name: data
mountPath: "/data"
- name: synapse-conf
mountPath: "/conf"
containers:
- name: nginx
image: ungleich/ungleich-certbot:1.1.1
ports:
- containerPort: 443
name: https
- containerPort: 80
name: http
env:
- name: DOMAIN
value: "{{ tpl .Values.synapseFQDN . }}"
- name: EMAIL
value: "{{ .Values.email }}"
{{ if eq .Values.letsencryptStaging "no" }}
- name: STAGING
value: "no"
{{ end }}
volumeMounts:
- name: nginx-config-proxy
mountPath: "/nginx-configs"
- name: etcletsencrypt
mountPath: "/etc/letsencrypt"
- name: synapse
image: matrixdotorg/synapse:{{ .Values.synapseVersion }}
ports:
- containerPort: 8008
env:
- name: SYNAPSE_CONFIG_PATH
value: "/conf/homeserver.yaml"
- name: SYNAPSE_CONFIG_DIR
value: "/conf"
volumeMounts:
- name: data
mountPath: "/data"
- name: synapse-conf
mountPath: "/conf"
volumes:
- name: etcletsencrypt
persistentVolumeClaim:
claimName: {{ .Release.Name }}-synapse-letsencrypt-certs
- name: data
persistentVolumeClaim:
claimName: {{ .Release.Name }}-data
- name: postgres-vars
secret:
secretName: {{ .Release.Name }}-postgres-config
- name: nginx-config
configMap:
name: {{ .Release.Name }}-nginx-config
- name: synapse-conf
configMap:
name: {{ .Release.Name }}-synapse-conf
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
labels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: matrix-synapse
spec:
type: ClusterIP
ports:
- port: 80
name: http
- port: 443
name: https
selector:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: matrix-synapse
# database:
# name: "psycopg2"
# args:
# database: "matrix-synapse"
# host: "localhost"
# user: "matrix-synapse"
# password: ""
# cp_min: 10
# cp_min: 5
# log_config: "/baseconfig/log.yaml"