From 806f05458cc6975fae2e7eec94dffa162cb47178 Mon Sep 17 00:00:00 2001 From: na2na-p Date: Mon, 27 Nov 2023 14:25:27 +0900 Subject: [PATCH] =?UTF-8?q?Kubernetes=E3=83=9E=E3=83=8B=E3=83=95=E3=82=A7?= =?UTF-8?q?=E3=82=B9=E3=83=88=E6=9B=B8=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .tool-versions | 1 + infra/k8s/manifests/app-deployment.yml | 29 +++++++++++++++++++++++ infra/k8s/manifests/configmap.example.yml | 8 +++++++ 4 files changed, 39 insertions(+) create mode 100644 infra/k8s/manifests/app-deployment.yml create mode 100644 infra/k8s/manifests/configmap.example.yml diff --git a/.gitignore b/.gitignore index 51b09909..a48640c0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ coverage built/ .env .idea +configmap.yml diff --git a/.tool-versions b/.tool-versions index 5d2f6c72..6afa0f3e 100644 --- a/.tool-versions +++ b/.tool-versions @@ -2,3 +2,4 @@ nodejs 20.9.0 pnpm 8.10.5 python 3.11.6 ffmpeg 6.1 +kubectl 1.28.4 diff --git a/infra/k8s/manifests/app-deployment.yml b/infra/k8s/manifests/app-deployment.yml new file mode 100644 index 00000000..10c72d8f --- /dev/null +++ b/infra/k8s/manifests/app-deployment.yml @@ -0,0 +1,29 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: jetdisc +spec: + replicas: 1 + selector: + matchLabels: + app: jetdisc + strategy: + type: Recreate + template: + metadata: + labels: + app: jetdisc + environment: production + version: "1.0.0" + spec: + containers: + - name: jetdisc + image: na2na/jetdisc:preview + envFrom: + - configMapRef: + name: jetdisc-config + resources: + limits: + cpu: 500m + memory: 256Mi + restartPolicy: Always diff --git a/infra/k8s/manifests/configmap.example.yml b/infra/k8s/manifests/configmap.example.yml new file mode 100644 index 00000000..03fce41b --- /dev/null +++ b/infra/k8s/manifests/configmap.example.yml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: jetdisc-config +data: + DISCORD_APP_TOKEN: "" + BOT_NAME: "2na2" + SET_COMMANDS_TARGET_SERVERS: ""