Synapse/manifests/bridges/messenger/job.yaml

47 lines
1.3 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: messenger-db-init
namespace: synapse
spec:
template:
spec:
containers:
- name: messenger-db-init
image: postgres:15.10
command: ["/bin/bash", "/data/create_db.sh"]
env:
- name: PGHOST
value: synapse-db-rw.synapse.svc.cluster.local
- name: PGUSER
valueFrom:
secretKeyRef:
name: synapse-db-superuser
key: username
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: synapse-db-superuser
key: password
- name: messenger_USER
valueFrom:
secretKeyRef:
name: mautrix-messenger-db
key: username
- name: messenger_PASSWORD
valueFrom:
secretKeyRef:
name: mautrix-messenger-db
key: password
- name: messenger_DB
value: messenger
volumeMounts:
- name: create-db
mountPath: /data
volumes:
- name: create-db
configMap:
name: messenger-db-creation
restartPolicy: Never
backoffLimit: 4