Files
site11/k8s/pipeline/ai-article-generator.yaml
jungwoo choi 46b5135f45 feat: Add hybrid deployment with Docker and Kubernetes
- 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
2025-09-28 21:03:14 +09:00

78 lines
1.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: pipeline-ai-article-generator
namespace: site11-pipeline
labels:
app: pipeline-ai-article-generator
component: processor
spec:
replicas: 2
selector:
matchLabels:
app: pipeline-ai-article-generator
template:
metadata:
labels:
app: pipeline-ai-article-generator
component: processor
spec:
containers:
- name: ai-article-generator
image: site11/pipeline-ai-article-generator: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-ai-article-generator-hpa
namespace: site11-pipeline
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: pipeline-ai-article-generator
minReplicas: 1
maxReplicas: 8
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80