b7f226062c
Wyniki wyszukań (librarian) i eventy 'now playing' (musician) POST-owane do bota ginęły, bo droga powrotna do bota była krucha: * Service 'bot' był NodePort BEZ przypiętego nodePort -> k8s losował port z 30000-32767 przy każdym (od)tworzeniu Service, a musician/betoniarka z Dockera adresują bota na sztywno http://192.168.1.73:32442. Rozjazd = każdy POST leci w zamknięty port. Przypinam nodePort: 32442. * Librarian jest w tym samym klastrze co bot, a mimo to szedł przez nodePort węzła. Przełączam na DNS Service'u http://bot:5000 - odporne na przetasowania nodePortu (nodePort zostaje tylko dla zewnętrznych z Dockera). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
58 lines
2.2 KiB
YAML
58 lines
2.2 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: librarian
|
|
namespace: conjurer
|
|
spec:
|
|
replicas: 1
|
|
selector: { matchLabels: { app: librarian } }
|
|
template:
|
|
metadata: { labels: { app: librarian } }
|
|
spec:
|
|
imagePullSecrets: [{ name: gitea-registry }]
|
|
containers:
|
|
- name: librarian
|
|
image: gitea.czernobog.pl/gitea/conjurer-librarian:e243777e
|
|
ports: [{ containerPort: 5001 }]
|
|
env:
|
|
- { name: CONJURER_LIBRARIAN_HOST, value: "0.0.0.0" }
|
|
- { name: CONJURER_LIBRARIAN_PORT, value: "5001" }
|
|
- { name: CONJURER_LIBRARIAN_DB_PATH, value: "/doi/" }
|
|
- { name: CONJURER_API_KEY, value: "d97008b3-7a5a-11f1-acd1-000b0e0f00ed" }
|
|
- { name: CONJURER_LIBRARIAN_MAXTHREADS, value: "40" }
|
|
- { name: CONJURER_CROSSREF_MAILTO, value: "mtuszowski@gmail.com" }
|
|
- { name: CONJURER_LIBRARIAN_CHUNK, value: "_chunk.txt" }
|
|
# Librarian jest W TYM SAMYM klastrze/namespace co bot - gada z nim
|
|
# po DNS Service'u, nie przez nodePort węzła (ten zostaje tylko dla
|
|
# zewnętrznych musician/betoniarka z Dockera). Odporne na przetasowania.
|
|
- { name: CONJURER_MAIN_BOT, value: "http://bot:5000" }
|
|
|
|
- { name: CONJURER_LIBRARIAN_STATE_DIR, value: "/lib_temp_files" }
|
|
|
|
volumeMounts:
|
|
- { name: doi, mountPath: /doi, readOnly: true }
|
|
- { name: state, mountPath: /lib_temp_files }
|
|
resources:
|
|
requests: { cpu: "100m", memory: "256Mi" }
|
|
limits: { cpu: "1", memory: "1Gi" }
|
|
volumes:
|
|
- name: doi
|
|
nfs:
|
|
server: 192.168.1.34
|
|
path: /mnt/Tank1/conjurer_swap/librarian_data/base_it1
|
|
- name: state
|
|
persistentVolumeClaim: { claimName: librarian-state }
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata: { name: librarian-state, namespace: conjurer }
|
|
spec:
|
|
accessModes: [ReadWriteOnce]
|
|
resources: { requests: { storage: 1Gi } }
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata: { name: librarian, namespace: conjurer }
|
|
spec:
|
|
selector: { app: librarian }
|
|
ports: [{ port: 5001, targetPort: 5001 }] |