🔧 Deployment configs: DAGI Router + Swapper Service для NODE1/NODE3
- K8s deployment для DAGI Router (NODE1) - K8s deployment для Swapper Service (NODE1) - ConfigMaps для конфігурацій - Services (ClusterIP + NodePort) - Інтеграція з NATS JetStream - Оновлено DEPLOYMENT-PLAN.md з конкретними інструкціями TODO: Створити аналоги для NODE3
This commit is contained in:
@@ -159,34 +159,48 @@ git remote -v | grep gitlab
|
|||||||
|
|
||||||
## 🔧 Інструкції для встановлення
|
## 🔧 Інструкції для встановлення
|
||||||
|
|
||||||
### DAGI Router на NODE1
|
### DAGI Router на NODE1 (K8s)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Копіювання конфігурації
|
# 1. Застосування K8s deployment
|
||||||
scp services/router/router_config.yaml root@144.76.224.179:/opt/microdao-daarion/
|
kubectl apply -f infrastructure/deployment/dagi-router-node1.yaml
|
||||||
|
|
||||||
# 2. Docker Compose або K8s deployment
|
# 2. Перевірка статусу
|
||||||
# (залежить від обраного підходу)
|
kubectl get pods -n daarion -l app=dagi-router
|
||||||
|
|
||||||
# 3. Інтеграція з NATS JetStream
|
# 3. Перевірка health
|
||||||
# Оновити router_config.yaml для використання NATS
|
kubectl port-forward -n daarion svc/dagi-router 9102:9102
|
||||||
|
curl http://localhost:9102/health
|
||||||
```
|
```
|
||||||
|
|
||||||
### DAGI Router на NODE3
|
### DAGI Router на NODE3 (K8s)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Аналогічно до NODE1
|
# Аналогічно до NODE1
|
||||||
# + інтеграція з Ollama на NODE3
|
# + інтеграція з Ollama на NODE3 (через Ollama service)
|
||||||
|
kubectl apply -f infrastructure/deployment/dagi-router-node3.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
### Swapper Service на NODE1/NODE3
|
### Swapper Service на NODE1 (K8s)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Копіювання конфігурації
|
# 1. Застосування K8s deployment
|
||||||
scp services/swapper-service/config/swapper_config.yaml root@NODE:/opt/
|
kubectl apply -f infrastructure/deployment/swapper-service-node1.yaml
|
||||||
|
|
||||||
# 2. Docker Compose або K8s deployment
|
# 2. Перевірка статусу
|
||||||
# 3. Інтеграція з Router
|
kubectl get pods -n daarion -l app=swapper-service
|
||||||
|
|
||||||
|
# 3. Перевірка health
|
||||||
|
kubectl port-forward -n daarion svc/swapper-service 8890:8890
|
||||||
|
curl http://localhost:8890/health
|
||||||
|
```
|
||||||
|
|
||||||
|
### Swapper Service на NODE3 (K8s)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Аналогічно до NODE1
|
||||||
|
# + використання GPU на NODE3 для моделей
|
||||||
|
kubectl apply -f infrastructure/deployment/swapper-service-node3.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
105
infrastructure/deployment/dagi-router-node1.yaml
Normal file
105
infrastructure/deployment/dagi-router-node1.yaml
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
---
|
||||||
|
# DAGI Router Deployment для NODE1 (K8s)
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: dagi-router
|
||||||
|
namespace: daarion
|
||||||
|
labels:
|
||||||
|
app: dagi-router
|
||||||
|
component: router
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: dagi-router
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: dagi-router
|
||||||
|
component: router
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: node1-daarion
|
||||||
|
containers:
|
||||||
|
- name: router
|
||||||
|
image: ghcr.io/daarion-dao/dagi-router:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 9102
|
||||||
|
name: http
|
||||||
|
env:
|
||||||
|
- name: NATS_URL
|
||||||
|
value: "nats://nats-client.nats:4222"
|
||||||
|
- name: ROUTER_CONFIG_PATH
|
||||||
|
value: "/etc/router/router_config.yaml"
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
value: "info"
|
||||||
|
volumeMounts:
|
||||||
|
- name: router-config
|
||||||
|
mountPath: /etc/router
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "256Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
limits:
|
||||||
|
memory: "512Mi"
|
||||||
|
cpu: "500m"
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 9102
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 9102
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 5
|
||||||
|
volumes:
|
||||||
|
- name: router-config
|
||||||
|
configMap:
|
||||||
|
name: dagi-router-config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: dagi-router-config
|
||||||
|
namespace: daarion
|
||||||
|
data:
|
||||||
|
router_config.yaml: |
|
||||||
|
routing:
|
||||||
|
target_subject: "router.invoke.agent"
|
||||||
|
nats_url: "nats://nats-client.nats:4222"
|
||||||
|
services:
|
||||||
|
memory_service: "http://memory-service.daarion:8000"
|
||||||
|
swapper_service: "http://swapper-service.daarion:8890"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: dagi-router
|
||||||
|
namespace: daarion
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: dagi-router
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 9102
|
||||||
|
targetPort: 9102
|
||||||
|
type: ClusterIP
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: dagi-router-external
|
||||||
|
namespace: daarion
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: dagi-router
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 9102
|
||||||
|
targetPort: 9102
|
||||||
|
nodePort: 30102
|
||||||
|
type: NodePort
|
||||||
92
infrastructure/deployment/swapper-service-node1.yaml
Normal file
92
infrastructure/deployment/swapper-service-node1.yaml
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
---
|
||||||
|
# Swapper Service Deployment для NODE1 (K8s)
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: swapper-service
|
||||||
|
namespace: daarion
|
||||||
|
labels:
|
||||||
|
app: swapper-service
|
||||||
|
component: llm-manager
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: swapper-service
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: swapper-service
|
||||||
|
component: llm-manager
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: node1-daarion
|
||||||
|
containers:
|
||||||
|
- name: swapper
|
||||||
|
image: ghcr.io/daarion-dao/swapper-service:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 8890
|
||||||
|
name: http
|
||||||
|
- containerPort: 8891
|
||||||
|
name: metrics
|
||||||
|
env:
|
||||||
|
- name: OLLAMA_HOST
|
||||||
|
value: "http://ollama-service:11434"
|
||||||
|
- name: SWAPPER_CONFIG_PATH
|
||||||
|
value: "/etc/swapper/swapper_config.yaml"
|
||||||
|
volumeMounts:
|
||||||
|
- name: swapper-config
|
||||||
|
mountPath: /etc/swapper
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "512Mi"
|
||||||
|
cpu: "200m"
|
||||||
|
limits:
|
||||||
|
memory: "2Gi"
|
||||||
|
cpu: "1000m"
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 8890
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 8890
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 5
|
||||||
|
volumes:
|
||||||
|
- name: swapper-config
|
||||||
|
configMap:
|
||||||
|
name: swapper-service-config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: swapper-service-config
|
||||||
|
namespace: daarion
|
||||||
|
data:
|
||||||
|
swapper_config.yaml: |
|
||||||
|
# Swapper Service Configuration
|
||||||
|
default_model: "llama3:8b"
|
||||||
|
vision_model: "vision-8b"
|
||||||
|
ollama_host: "http://ollama-service:11434"
|
||||||
|
max_concurrent_requests: 10
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: swapper-service
|
||||||
|
namespace: daarion
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: swapper-service
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 8890
|
||||||
|
targetPort: 8890
|
||||||
|
- name: metrics
|
||||||
|
port: 8891
|
||||||
|
targetPort: 8891
|
||||||
|
type: ClusterIP
|
||||||
Reference in New Issue
Block a user