47 lines
1.3 KiB
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
|