Files
yingqing/k8s/core/worker-deployment.yaml

47 lines
1.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: airshelf-core-worker
labels:
app: airshelf-core-worker
spec:
replicas: 1
selector:
matchLabels:
app: airshelf-core-worker
template:
metadata:
labels:
app: airshelf-core-worker
spec:
imagePullSecrets:
- name: cr-pull-secret
containers:
- name: airshelf-core-worker
image: ${CI_REGISTRY_IMAGE}/airshelf-core-api:latest
imagePullPolicy: Always
# Celery worker connects to the external (Volcano managed) Redis broker
# configured via the airshelf-core-env secret. Uses `args` (not `command`)
# so the image ENTRYPOINT still runs but skips migrate/collectstatic ($1=celery).
# 本 Pod 只吃默认 celery 队列(出图/出片等慢活)。提取/通知/脚本思考在 worker-quick。
args: ["celery", "-A", "airshelf.celery:app", "worker", "-l", "info", "-Q", "celery", "--concurrency", "4"]
envFrom:
- secretRef:
name: airshelf-core-env
livenessProbe:
exec:
command: ["sh", "-c", "celery -A airshelf.celery:app inspect ping"]
initialDelaySeconds: 40
periodSeconds: 60
timeoutSeconds: 15
failureThreshold: 3
resources:
requests:
# 出图任务把成品图/视频整张下载进内存再上传 TOS,叠 concurrency 4 峰值大;
# 768Mi 会 OOMKilled(Exit 137)连带 worker 反复重启 → 生成入口 503,故抬到 2Gi。
memory: "512Mi"
cpu: "100m"
limits:
memory: "2Gi"
cpu: "1000m"