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