Skip to content

Commit

Permalink
Merge pull request #1395 from GiganticMinecraft/add-discord_bot-idea_…
Browse files Browse the repository at this point in the history
…reaction

feat: idea-reaction の Pod を追加
  • Loading branch information
Sho Sakuma authored Nov 10, 2023
2 parents 5ffc5f6 + 5ce1bb9 commit 75c51cb
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
matadata:
name: idea-reaction-config
data:
config.yaml: |
reactions: ["👍", "👎"]
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions terraform/onp_cluster_minecraft_secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 75c51cb

Please sign in to comment.