- Docker Compose for infrastructure (MongoDB, Redis, Kafka, Zookeeper) - Docker for central control (Scheduler, Monitor, Language Sync) - K8s for scalable workers (RSS, Google Search, Translator, AI Generator, Image Generator) - Automatic scaling with HPA (Horizontal Pod Autoscaler) - Comprehensive deployment scripts and documentation - Updated README with hybrid deployment guide
78 lines
1.8 KiB
YAML
78 lines
1.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: pipeline-translator
|
|
namespace: site11-pipeline
|
|
labels:
|
|
app: pipeline-translator
|
|
component: processor
|
|
spec:
|
|
replicas: 3
|
|
selector:
|
|
matchLabels:
|
|
app: pipeline-translator
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: pipeline-translator
|
|
component: processor
|
|
spec:
|
|
containers:
|
|
- name: translator
|
|
image: site11/pipeline-translator:latest
|
|
imagePullPolicy: Always
|
|
envFrom:
|
|
- configMapRef:
|
|
name: pipeline-config
|
|
- secretRef:
|
|
name: pipeline-secrets
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "200m"
|
|
limits:
|
|
memory: "1Gi"
|
|
cpu: "1000m"
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- python
|
|
- -c
|
|
- "import redis; r=redis.from_url('redis://host.docker.internal:6379'); r.ping()"
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 30
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- python
|
|
- -c
|
|
- "import redis; r=redis.from_url('redis://host.docker.internal:6379'); r.ping()"
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
|
|
---
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: pipeline-translator-hpa
|
|
namespace: site11-pipeline
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: pipeline-translator
|
|
minReplicas: 2
|
|
maxReplicas: 10
|
|
metrics:
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 70
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 80 |