# Listmonk DB Init Job # Creates listmonk database and user in PostgreSQL. # Run once before deploying Listmonk. # # Deploy: # kubectl create secret generic listmonk-secret \ # --from-literal=db-password='' \ # --from-literal=admin-password='' \ # --from-literal=postmark-token='' # kubectl apply -f listmonk-db-init.yaml # # Watch completion: # kubectl get jobs -w # kubectl logs job/listmonk-db-init apiVersion: batch/v1 kind: Job metadata: name: listmonk-db-init spec: template: spec: restartPolicy: OnFailure containers: - name: listmonk-db-init image: postgres:16 env: - name: PGPASSWORD valueFrom: secretKeyRef: name: postgres-secret key: password - name: LISTMONK_DB_PASSWORD valueFrom: secretKeyRef: name: listmonk-secret key: db-password command: - /bin/sh - -c - | psql -h postgres -U postgres <