From 97a15f955c5f99921bd7c2e4572e8e74eb9f6a1f Mon Sep 17 00:00:00 2001 From: outductor Date: Tue, 3 Oct 2023 07:05:33 +0900 Subject: [PATCH] add password --- terraform/onp_cluster_secrets.tf | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/terraform/onp_cluster_secrets.tf b/terraform/onp_cluster_secrets.tf index e996c088b..b8ae03c00 100644 --- a/terraform/onp_cluster_secrets.tf +++ b/terraform/onp_cluster_secrets.tf @@ -196,3 +196,34 @@ resource "helm_release" "onp_minecraft_mariadb_monitoring_password" { ] } } + +resource "random_password" "minecraft__pr_review_mariadb_password" { + length = 16 + special = false // MariaDBのパスワードがぶっ壊れて困るので記号を含めない +} + +resource "helm_release" "onp_minecraft__pr_review_mariadb_password" { + depends_on = [helm_release.onp_cluster_clustersecret] + + repository = "https://giganticminecraft.github.io/seichi_infra/" + chart = "raw-resources" + name = "mariadb-pr-review-password-raw-resource" + namespace = "kube-system" + version = "0.3.0" + + set_list { + name = "manifests" + value = [<<-EOS + kind: ClusterSecret + apiVersion: clustersecret.io/v1 + metadata: + namespace: clustersecret + name: mariadb-pr-review-password + matchNamespace: + - seichi-debug-minecraft-on-seichiassist-pr-* + data: + mcserver-password: ${base64encode(random_password.minecraft__pr_review_mariadb_password.result)} + EOS + ] + } +}