diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/babyrite/babyrite.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/babyrite/babyrite.yaml new file mode 100644 index 000000000..75e9473d8 --- /dev/null +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/babyrite/babyrite.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: babyrite + namespace: seichi-minecraft + labels: + app: babyrite +spec: + replicas: 1 + selector: + matchLabels: + app: babyrite + template: + metadata: + labels: + app: babyrite + spec: + - name: babyrite + image: ghcr.io/m1sk9/babyrite:v0.9.2 + resources: + requests: + cpu: 250m + memory: 16Mi + limits: + cpu: 500m + memory: 32Mi + volumeMounts: + - name: babyrite-config-volume + mountPath: /home/babyrite/config/config.yaml + env: + # 相対パスを指定する + - name: CONFIG_FILE_PATH + value: "config/config.yaml" + - name: DISCORD_API_TOKEN + valueFrom: + secretKeyRef: + name: babyrite-discord-token + key: BABYRITE_DISCORD_TOKEN + volumes: + - name: babyrite-config-volume + configMap: + name: babyrite-config + diff --git a/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/common-configs/babyrite-config.yaml b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/common-configs/babyrite-config.yaml new file mode 100644 index 000000000..5d864974e --- /dev/null +++ b/seichi-onp-k8s/manifests/seichi-kubernetes/apps/seichi-minecraft/common-configs/babyrite-config.yaml @@ -0,0 +1,12 @@ +# babyrite Config +# This file is used to configure babyrite. +# You can change the settings here to customize babyrite's behavior. +# For more information, see the babyrite documentation at https://babyrite.m1sk9.dev/configuration.html + +apiVersion: v1 +kind: ConfigMap +metadata: + name: babyrite-config +data: + config.yaml: | + bypass_guilds: false diff --git a/terraform/main.tf b/terraform/main.tf index 98d8dd4b6..25ba7bac5 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -304,6 +304,12 @@ variable "minecraft__idea_reaction_redmine_api_key" { sensitive = true } +variable "discord_bot__babyrite_discord_token" { + description = "Token set to the production babyrite" + type = string + sensitive = true +} + #endregion #region env variables for Cloudflare Pages projects diff --git a/terraform/onp_cluster_secrets.tf b/terraform/onp_cluster_secrets.tf index 14a0d5906..033f065e8 100644 --- a/terraform/onp_cluster_secrets.tf +++ b/terraform/onp_cluster_secrets.tf @@ -292,3 +292,16 @@ resource "kubernetes_secret" "idea_reaction_redmine_api_key" { IDEA_REACTION_REDMINE_API_KEY = var.minecraft__idea_reaction_redmine_api_key } } + +resource "kubernetes_secret" "babyrite_discord_token" { + depends_on = [kubernetes_namespace.onp_seichi_minecraft] + + metadata { + name = "babyrite-discord-token" + namespace = "seichi-minecraft" + } + + data = { + BABYRITE_DISCORD_TOKEN = var.discord_bot__babyrite_discord_token + } +}