apiVersion: batch/v1 kind: Job metadata: name: telegram-db-init namespace: synapse spec: template: spec: containers: - name: telegram-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: TELEGRAM_USER valueFrom: secretKeyRef: name: mautrix-telegram-db key: username - name: TELEGRAM_PASSWORD valueFrom: secretKeyRef: name: mautrix-telegram-db key: password - name: TELEGRAM_DB value: telegram volumeMounts: - name: create-db mountPath: /data volumes: - name: create-db configMap: name: telegram-db-creation restartPolicy: Never backoffLimit: 4