Skip to content

Commit

Permalink
Merge pull request #2142 from GiganticMinecraft/add-babyrite-pod
Browse files Browse the repository at this point in the history
feat: Add babyrite pod
  • Loading branch information
outductor authored Sep 2, 2024
2 parents 62735d2 + a439117 commit b9ec170
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions terraform/onp_cluster_secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit b9ec170

Please sign in to comment.