diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/common-configs/idea-reaction-config.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/common-configs/idea-reaction-config.yaml new file mode 100644 index 000000000..054107ed4 --- /dev/null +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/common-configs/idea-reaction-config.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +matadata: + name: idea-reaction-config +data: + config.yaml: | + reactions: ["👍", "👎"] diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/idea-reaction/idea-reaction.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/idea-reaction/idea-reaction.yaml new file mode 100644 index 000000000..258e5ac6f --- /dev/null +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/idea-reaction/idea-reaction.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: idea-reaction + namespace: seichi-minecraft + labels: + app: idea-reaction +spec: + replicas: 1 + selector: + matchLabels: + app: idea-reaction + template: + metadata: + labels: + app: idea-reaction + spec: + - name: idea-reaction + image: ghcr.io/giganticminecraft/idea-reaction:42a57b77637240c64672a6a64cc909a0c50509fa + resources: + requests: + cpu: 250m + memory: 16Mi + limits: + cpu: 500m + memory: 32Mi + volumeMounts: + - name: idea-reaction-config-volume + mountPath: /home/idea-reaction/assets/config.yaml + env: + - name: TARGET_CHANNEL_ID + value: "959292335177486367" + # Webhook ID は Webhook た UserId べ搌侀ぼため, ć…Źé–‹æƒ…ć ±ă«ăȘる. + - name: TARGET_WEBHOOK_ID + value: "959307225413845072" + - name: TARGET_GUILD_ID + value: "237758724121427969" + - name: DISCORD_TOKEN + valueFrom: + secretKeyRef: + name: idea-reaction-discord-token + key: IDEA_REACTION_DISCORD_TOKEN + volumes: + - name: idea-reaction-config-volume + configMap: + name: idea-reaction-config diff --git a/terraform/main.tf b/terraform/main.tf index a160ab34c..88c4ab742 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -286,6 +286,12 @@ variable "minecraft__prod_game_db__password" { sensitive = true } +variable "minecraft__idea_reaction_discord_token" { + description = "Token set to the production idea-reaction" + type = string + sensitive = true +} + #endregion #region env variables for Cloudflare Pages projects diff --git a/terraform/onp_cluster_minecraft_secrets.tf b/terraform/onp_cluster_minecraft_secrets.tf index 25dc63bbb..b173dae53 100644 --- a/terraform/onp_cluster_minecraft_secrets.tf +++ b/terraform/onp_cluster_minecraft_secrets.tf @@ -22,8 +22,9 @@ resource "kubernetes_secret" "onp_minecraft_prod_secrets" { } data = { - DISCORDSRV_TOKEN = var.minecraft__discordsrv_bot_token - GAME_DB_PASSWORD = var.minecraft__prod_game_db__password + DISCORDSRV_TOKEN = var.minecraft__discordsrv_bot_token + GAME_DB_PASSWORD = var.minecraft__prod_game_db__password + IDEA_REACTION_DISCORD_TOKEN = var.minecraft__idea_reaction_discord_token } type = "Opaque"