Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a9955a736b |
@@ -8,21 +8,6 @@ Warstwy: `presentation` (wejście z przeglądarki przez **Ingress po https**)
|
|||||||
|
|
||||||
Adres aplikacji: **https://astrololo.czernobog.pl** — patrz [TLS](#-tls--wymagane-kroki-przed-wdrożeniem).
|
Adres aplikacji: **https://astrololo.czernobog.pl** — patrz [TLS](#-tls--wymagane-kroki-przed-wdrożeniem).
|
||||||
|
|
||||||
## Co śledzi image-updater — [`image-updater.yaml`](image-updater.yaml)
|
|
||||||
|
|
||||||
Lista obrazów podbijanych automatycznie jest **jawna** i żyje w CRD `ImageUpdater`
|
|
||||||
(ns `argocd`). Obraz, którego na niej nie ma, **nigdy się nie podbije**, choćby CI
|
|
||||||
go budowało — tak przez chwilę wisiał `render` na `:latest`, zanim dopisaliśmy go do
|
|
||||||
listy. Dodając nową usługę, dopisz jej wpis w `image-updater.yaml` i nałóż:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
kubectl apply -f astrololo/image-updater.yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
Ten plik **celowo nie jest w `kustomization.yaml`**: resource stoi w ns `argocd`
|
|
||||||
(poza namespace docelowym aplikacji), a to konfiguracja kontrolera, który wdraża tę
|
|
||||||
aplikację — nakładamy go ręcznie, w repo trzymamy dla odtwarzalności i historii.
|
|
||||||
|
|
||||||
## ⚠️ Sekret `astrololo-auth` — utwórz PRZED wdrożeniem
|
## ⚠️ Sekret `astrololo-auth` — utwórz PRZED wdrożeniem
|
||||||
|
|
||||||
Aplikacja wystawia treść **oryginalnych baz interpretacyjnych**, dlatego wymaga
|
Aplikacja wystawia treść **oryginalnych baz interpretacyjnych**, dlatego wymaga
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
# Konfiguracja argocd-image-updater dla astrololo — ŹRÓDŁO PRAWDY tego, CO śledzimy.
|
|
||||||
#
|
|
||||||
# Model v1.x: osobny CRD `ImageUpdater` w ns `argocd` (nie adnotacje na Application).
|
|
||||||
# Lista `images` jest JAWNA — obraz, którego tu NIE MA, nigdy nie zostanie podbity,
|
|
||||||
# choćby CI go budowało. Tak przez chwilę wisiał `render` na `:latest` (PRE-24):
|
|
||||||
# usługa istniała i budowała tag SHA, ale updater jej nie znał, więc kustomization
|
|
||||||
# jej nie ruszał. Dopisanie wpisu = wejście usługi do rotacji.
|
|
||||||
#
|
|
||||||
# ⚠️ TEGO PLIKU NIE MA w astrololo/kustomization.yaml i NIE MA GO TAM MIEĆ:
|
|
||||||
# 1. resource żyje w ns `argocd`, a Application astrololo celuje w ns `astrololo`
|
|
||||||
# — auto-sync przez kustomize próbowałby zapisać poza swój namespace docelowy;
|
|
||||||
# 2. to konfiguracja kontrolera, który wdraża tę właśnie aplikację — niech app
|
|
||||||
# nie zarządza narzędziem, które ją wdraża.
|
|
||||||
# Plik jest trzymany w repo dla odtwarzalności i historii; nakłada się go RĘCZNIE:
|
|
||||||
# kubectl apply -f astrololo/image-updater.yaml
|
|
||||||
#
|
|
||||||
# Strategia `newest-build`: updater bierze obraz o NAJNOWSZYM znaczniku czasu builda
|
|
||||||
# i zapisuje jego tag SHA do kustomization (write-back git). Uwaga na reprodukowalne
|
|
||||||
# buildy — identyczny `created` na kilku tagach potrafi zablokować wybór najnowszego.
|
|
||||||
apiVersion: argocd-image-updater.argoproj.io/v1alpha1
|
|
||||||
kind: ImageUpdater
|
|
||||||
metadata:
|
|
||||||
name: astrololo
|
|
||||||
namespace: argocd
|
|
||||||
spec:
|
|
||||||
applicationRefs:
|
|
||||||
- namePattern: astrololo
|
|
||||||
images:
|
|
||||||
- alias: data
|
|
||||||
imageName: gitea.czernobog.pl/gitea/astrololo-data
|
|
||||||
- alias: logic
|
|
||||||
imageName: gitea.czernobog.pl/gitea/astrololo-logic
|
|
||||||
- alias: presentation
|
|
||||||
imageName: gitea.czernobog.pl/gitea/astrololo-presentation
|
|
||||||
- alias: render
|
|
||||||
imageName: gitea.czernobog.pl/gitea/astrololo-render
|
|
||||||
commonUpdateSettings:
|
|
||||||
updateStrategy: newest-build
|
|
||||||
writeBackConfig:
|
|
||||||
method: git:secret:argocd/git-creds
|
|
||||||
gitConfig:
|
|
||||||
repository: https://gitea.czernobog.pl/gitea/deploy.git
|
|
||||||
branch: master
|
|
||||||
writeBackTarget: kustomization:/astrololo
|
|
||||||
@@ -10,10 +10,10 @@ resources:
|
|||||||
- ingress.yaml # wejście po https + przekierowanie z http
|
- ingress.yaml # wejście po https + przekierowanie z http
|
||||||
images:
|
images:
|
||||||
- name: gitea.czernobog.pl/gitea/astrololo-data
|
- name: gitea.czernobog.pl/gitea/astrololo-data
|
||||||
newTag: 8ebce816
|
newTag: f34016a4
|
||||||
- name: gitea.czernobog.pl/gitea/astrololo-logic
|
- name: gitea.czernobog.pl/gitea/astrololo-logic
|
||||||
newTag: 8ebce816
|
newTag: f34016a4
|
||||||
- name: gitea.czernobog.pl/gitea/astrololo-render
|
- name: gitea.czernobog.pl/gitea/astrololo-render
|
||||||
newTag: latest
|
newTag: latest
|
||||||
- name: gitea.czernobog.pl/gitea/astrololo-presentation
|
- name: gitea.czernobog.pl/gitea/astrololo-presentation
|
||||||
newTag: 8ebce816
|
newTag: f34016a4
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
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" }
|
|
||||||
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 }]
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
apiVersion: argocd-image-updater.argoproj.io/v1alpha1
|
|
||||||
kind: ImageUpdater
|
|
||||||
metadata:
|
|
||||||
name: conjurer
|
|
||||||
namespace: argocd
|
|
||||||
spec:
|
|
||||||
commonUpdateSettings:
|
|
||||||
updateStrategy: "newest-build"
|
|
||||||
writeBackConfig:
|
|
||||||
method: "git:secret:argocd/git-creds"
|
|
||||||
gitConfig:
|
|
||||||
repository: "https://gitea.czernobog.pl/gitea/deploy.git"
|
|
||||||
branch: "master" # ← gałąź repo deploy
|
|
||||||
writeBackTarget: "kustomization:/conjurer"
|
|
||||||
applicationRefs:
|
|
||||||
- namePattern: "conjurer"
|
|
||||||
images:
|
|
||||||
- { alias: "librarian", imageName: "gitea.czernobog.pl/gitea/conjurer-librarian" }
|
|
||||||
- { alias: "bot", imageName: "gitea.czernobog.pl/gitea/conjurer-bot" }
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- namespace.yaml
|
|
||||||
- librarian.yaml
|
|
||||||
- bot.yaml
|
|
||||||
images:
|
|
||||||
- name: gitea.czernobog.pl/gitea/conjurer-librarian
|
|
||||||
newTag: 8e18071b
|
|
||||||
- name: gitea.czernobog.pl/gitea/conjurer-bot
|
|
||||||
newTag: 8e18071b
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
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: "512Mi" }
|
|
||||||
# Headroom bump: the work-queue OOM is fixed in code, but a deep
|
|
||||||
# search still pulls up to 15000 Crossref records into RAM and the
|
|
||||||
# accumulating result JSONs are loaded whole. 2Gi gives margin so a
|
|
||||||
# big search isn't OOM-killed. Tune down if the node is tight.
|
|
||||||
limits: { cpu: "1", memory: "2Gi" }
|
|
||||||
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 }]
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: conjurer
|
|
||||||
Reference in New Issue
Block a user