From 327028ce427ada05b70fba23940714f2fe29b7b4 Mon Sep 17 00:00:00 2001 From: migatu Date: Tue, 28 Jul 2026 13:40:49 +0200 Subject: [PATCH] bot --- conjurer/bot.yaml | 52 +++++++++++++++++++++++++++++++++++++ conjurer/kustomization.yaml | 3 ++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 conjurer/bot.yaml diff --git a/conjurer/bot.yaml b/conjurer/bot.yaml new file mode 100644 index 0000000..7878bd0 --- /dev/null +++ b/conjurer/bot.yaml @@ -0,0 +1,52 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: bot + namespace: conjurer +spec: + replicas: 1 # NIGDY więcej — jedna sesja gateway na token + strategy: { type: Recreate } # NIE RollingUpdate — dwa pody = wojna o sesję Discord + selector: { matchLabels: { app: bot } } + template: + metadata: { labels: { app: bot } } + spec: + imagePullSecrets: [{ name: gitea-registry }] + containers: + - name: bot + image: gitea.czernobog.pl/gitea/conjurer-bot:c8aae106 + ports: [{ containerPort: 5000 }] + env: + - { name: CONJURER_DATA_DIR, value: "/data" } + - { name: CONJURER_DISCORD_HOST, value: "0.0.0.0" } + - { name: CONJURER_DISCORD_PORT, value: "5000" } + # ↓ NAZWY PODSTAW WG WYNIKU grepa z 0.2 ↓ + - { name: CONJURER_LIBRARIAN_SERVICE, value: "http://librarian:5001" } + - { name: CONJURER_MUSICIAN_SERVICE, value: "http://192.168.1.89:5000" } + - { name: CONJURER_RADIO_SERVICE, value: "http://192.168.1.79:5005" } + - { name: CONJURER_RADIO_HARBOR, value: "http://192.168.1.79:54321" } + volumeMounts: + - { name: data, mountPath: /data } + - { name: netrc, mountPath: /secrets, readOnly: true } + resources: + requests: { cpu: "200m", memory: "256Mi" } + limits: { cpu: "2", memory: "1Gi" } + volumes: + - name: data + persistentVolumeClaim: { claimName: bot-data } + - name: netrc + secret: { secretName: conjurer-netrc } +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: { name: bot-data, namespace: conjurer } +spec: + accessModes: [ReadWriteOnce] + resources: { requests: { storage: 2Gi } } +--- +apiVersion: v1 +kind: Service +metadata: { name: bot, namespace: conjurer } +spec: + type: NodePort # radio/musician z Dockera muszą go dosięgnąć + selector: { app: bot } + ports: [{ port: 5000, targetPort: 5000 }] \ No newline at end of file diff --git a/conjurer/kustomization.yaml b/conjurer/kustomization.yaml index 9ea8266..90c484b 100644 --- a/conjurer/kustomization.yaml +++ b/conjurer/kustomization.yaml @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - namespace.yaml - - librarian.yaml \ No newline at end of file + - librarian.yaml + - bot.yaml \ No newline at end of file