优化架构K8s 副本和队列

This commit is contained in:
Azmat@qq.com
2026-09-03 16:38:02 +08:00
parent f53b6e1035
commit e7122b78fb
9 changed files with 80 additions and 10 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ metadata:
labels:
app: airshelf-core-api
spec:
replicas: 1
replicas: 2
selector:
matchLabels:
app: airshelf-core-api
+2 -1
View File
@@ -23,7 +23,8 @@ spec:
# 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).
args: ["celery", "-A", "airshelf.celery:app", "worker", "-l", "info", "-Q", "celery,airshelf.quick", "--concurrency", "4"]
# 本 Pod 只吃默认 celery 队列(出图/出片等慢活)。提取/通知/脚本思考在 worker-quick。
args: ["celery", "-A", "airshelf.celery:app", "worker", "-l", "info", "-Q", "celery", "--concurrency", "4"]
envFrom:
- secretRef:
name: airshelf-core-env
+42
View File
@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: airshelf-core-worker-quick
labels:
app: airshelf-core-worker-quick
spec:
replicas: 1
selector:
matchLabels:
app: airshelf-core-worker-quick
template:
metadata:
labels:
app: airshelf-core-worker-quick
spec:
imagePullSecrets:
- name: cr-pull-secret
containers:
- name: airshelf-core-worker-quick
image: ${CI_REGISTRY_IMAGE}/airshelf-core-api:latest
imagePullPolicy: Always
# 只消费 airshelf.quick:提取角色、通知补齐、脚本思考、视频状态轻轮询。
# 与出片 worker 隔离,Seedance 占满时提取仍能跑。
args: ["celery", "-A", "airshelf.celery:app", "worker", "-l", "info", "-Q", "airshelf.quick", "--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:
memory: "256Mi"
cpu: "100m"
limits:
memory: "1Gi"
cpu: "500m"