diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/app-templates/seichi-debug-minecraft-on-seichiassist-pr/templates/mariadb/mariadb.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/app-templates/seichi-debug-minecraft-on-seichiassist-pr/templates/mariadb/mariadb.yaml index bb77005ad..b5405e8d6 100644 --- a/seichi-onp-k8s/manifests/seichi-kubernetes/app-templates/seichi-debug-minecraft-on-seichiassist-pr/templates/mariadb/mariadb.yaml +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/app-templates/seichi-debug-minecraft-on-seichiassist-pr/templates/mariadb/mariadb.yaml @@ -3,6 +3,22 @@ kind: MariaDB metadata: name: mariadb spec: + initContainers: + - image: mariadb:10.11.6 + env: + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: mariadb-pr-review-password + key: prod-mariadb-password + volumeMounts: + - name: sqldump-volume + mountPath: /docker-entrypoint-initdb.d + args: + - "sh" + - "-c" + - 'mysqldump -umcserver -p${DB_PASSWORD} -h192.168.2.186 --databases seichiassist flyway_managed_schema > /docker-entrypoint-initdb.d/seichiassist.sql' + rootPasswordSecretKeyRef: name: mariadb-pr-review-password key: root-password @@ -30,5 +46,13 @@ spec: accessModes: - ReadWriteOnce + volumeMounts: + - name: sqldump-volume + mountPath: /docker-entrypoint-initdb.d + service: type: ClusterIP + + volumes: + - name: sqldump-volume + emptyDir: {} diff --git a/terraform/onp_cluster_secrets.tf b/terraform/onp_cluster_secrets.tf index 0fd963eff..5a2272d24 100644 --- a/terraform/onp_cluster_secrets.tf +++ b/terraform/onp_cluster_secrets.tf @@ -229,6 +229,7 @@ resource "helm_release" "onp_minecraft__pr_review_mariadb_password" { data: root-password: "" mcserver-password: "" + prod-mariadb-password: ${base64encode(var.minecraft__prod_game_db__password)} EOS ] }