# Ghost DB Init Job # Creates Ghost databases and users in MariaDB. # Run once before deploying Ghost instances. # Runs in default namespace — can access all secrets directly. # # Apply with: # kubectl apply -f ghost-db-init.yaml # # Watch completion: # kubectl get jobs -w # kubectl logs job/ghost-db-init apiVersion: batch/v1 kind: Job metadata: name: ghost-db-init spec: template: spec: restartPolicy: OnFailure containers: - name: ghost-db-init image: mariadb:11 env: - name: MARIADB_ROOT_PASSWORD valueFrom: secretKeyRef: name: mariadb-secret key: root-password - name: GHOST1_PASSWORD valueFrom: secretKeyRef: name: ghost-secrets key: ghost1-db-password - name: GHOST2_PASSWORD valueFrom: secretKeyRef: name: ghost-secrets key: ghost2-db-password - name: GHOST3_PASSWORD valueFrom: secretKeyRef: name: ghost-secrets key: ghost3-db-password command: - /bin/sh - -c - | mariadb -h mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" <