aeb9bb5940
Wires CONJURER_OLLAMA_URL into the test bot and the deploy bot so the
self-hosted backend from conjurer#25 is selectable. No API key exists for
Ollama - the endpoint is the whole configuration - and until it is set the
backend refuses to be selected, so this is what turns it on.
NOTE, verified from the LAN before committing: 192.168.1.72 answers ping
(0.4ms) but only port 22 is open - 11434 refuses. Ollama binds to
127.0.0.1:11434 by default, so it is not reachable off-host yet. This env
var is correct but inert until the server listens on the network:
sudo systemctl edit ollama.service
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
sudo systemctl daemon-reload && sudo systemctl restart ollama
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
67 lines
3.1 KiB
YAML
67 lines
3.1 KiB
YAML
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" }
|
|
- { name: CONJURER_API_KEY, value: "d97008b3-7a5a-11f1-acd1-000b0e0f00ed" }
|
|
- { name: CONJURER_NETRC_FILE, value: "/secrets/.netrc" }
|
|
# ↓ 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_FILE_SERVICE, value: "http://192.168.1.89:5000" }
|
|
|
|
- { name: CONJURER_RADIO_HARBOR, value: "http://192.168.1.79:54321" }
|
|
# Where the librarian sends THIS bot's results/pongs back to (its own
|
|
# NodePort). Lets one librarian serve both bots - see deploy-bot.yaml.
|
|
- { name: CONJURER_SELF_CALLBACK, value: "http://192.168.1.73:32442" }
|
|
# Self-hosted models (Ollama). No API key - the endpoint IS the
|
|
# configuration, and the backend stays unselectable while unset.
|
|
# Pick a model at runtime with: $gadaj_teraz ollama <model>
|
|
# ($modele_ai lists what the server actually has pulled).
|
|
- { name: CONJURER_OLLAMA_URL, value: "http://192.168.1.72:11434" }
|
|
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 }
|
|
# nodePort PRZYPIĘTY na sztywno. Bez tego k8s losuje port z 30000-32767 przy
|
|
# (od)tworzeniu Service, a musician/betoniarka z Dockera adresują bota po
|
|
# http://192.168.1.73:32442 na sztywno - rozjazd = wyniki/eventy giną w locie.
|
|
ports: [{ port: 5000, targetPort: 5000, nodePort: 32442 }] |