109 lines
2.6 KiB
YAML
109 lines
2.6 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: orchestrator-config
|
|
namespace: swarm-system
|
|
data:
|
|
REDIS_HOST: "redis-service"
|
|
REDIS_PORT: "6379"
|
|
LOG_LEVEL: "INFO"
|
|
SWARM_RUNTIME_SOURCE: "heicode-swarm-runtime"
|
|
SWARM_RUNTIME_PLATFORM: "aks"
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: orchestrator
|
|
namespace: swarm-system
|
|
labels:
|
|
app: orchestrator
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: orchestrator
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: orchestrator
|
|
spec:
|
|
serviceAccountName: orchestrator-sa
|
|
containers:
|
|
- name: orchestrator
|
|
image: python:3.11-slim
|
|
command: ["/bin/bash", "-c"]
|
|
args:
|
|
- |
|
|
apt-get update && apt-get install -y git
|
|
pip install --no-cache-dir -r /app/orchestrator/requirements.txt
|
|
cd /app
|
|
python -m uvicorn orchestrator.main:app --host 0.0.0.0 --port 8000
|
|
ports:
|
|
- containerPort: 8000
|
|
name: http
|
|
envFrom:
|
|
- configMapRef:
|
|
name: orchestrator-config
|
|
env:
|
|
- name: AGNET_RUNTIME_SERVICE_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: agnet-runtime-secrets
|
|
key: runtime-service-token
|
|
optional: true
|
|
- name: AGNET_CALLBACK_SERVICE_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: agnet-runtime-secrets
|
|
key: callback-service-token
|
|
optional: true
|
|
- name: AGNET_CALLBACK_SIGNING_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: agnet-runtime-secrets
|
|
key: callback-signing-secret
|
|
optional: true
|
|
volumeMounts:
|
|
- name: orchestrator-code
|
|
mountPath: /app/orchestrator
|
|
resources:
|
|
requests:
|
|
cpu: 500m
|
|
memory: 512Mi
|
|
limits:
|
|
cpu: 1000m
|
|
memory: 1Gi
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8000
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8000
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
volumes:
|
|
- name: orchestrator-code
|
|
configMap:
|
|
name: orchestrator-source
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: orchestrator-service
|
|
namespace: swarm-system
|
|
labels:
|
|
app: orchestrator
|
|
spec:
|
|
type: LoadBalancer
|
|
ports:
|
|
- port: 8000
|
|
targetPort: 8000
|
|
protocol: TCP
|
|
name: http
|
|
selector:
|
|
app: orchestrator
|