| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- # 模块 A + B 创建子系统 cronjob(P0-D,2026-06-09)
- # 与调控子系统(cronjob.yaml,02:00 UTC)错开 30 分钟运行,避免争抢腾讯/飞书 API
- # 流程:
- # Phase 0 模块 A 建广告(每账户 ADS_PER_ACCOUNT 条)
- # Phase 1 模块 B 给所有广告补创意(每广告 TARGET_CREATIVES_PER_AD 条)
- # 都走"先审后挂"飞书审批,审批通过才真 POST 腾讯
- apiVersion: batch/v1
- kind: CronJob
- metadata:
- name: auto-put-ad-mini-creation
- namespace: ad-automation
- labels:
- app: auto-put-ad-mini
- component: creation
- spec:
- schedule: "30 2 * * *" # 每天 02:30 UTC,与调控 02:00 UTC 错开 30 分钟
- concurrencyPolicy: Forbid # 不允许并发运行(主循环含 120 分钟轮询)
- successfulJobsHistoryLimit: 3
- failedJobsHistoryLimit: 3
- jobTemplate:
- spec:
- backoffLimit: 2
- # 4 小时超时(覆盖 120 分钟审批 × 2 phase + 余量)
- activeDeadlineSeconds: 14400
- template:
- metadata:
- labels:
- app: auto-put-ad-mini
- component: creation
- spec:
- restartPolicy: Never
- containers:
- - name: creation-engine
- image: your-registry/auto-put-ad-mini:latest
- imagePullPolicy: Always
- command: ["python", "execute_creation_once.py"]
- envFrom:
- - configMapRef:
- name: ad-config
- - secretRef:
- name: ad-secrets
- volumeMounts:
- - name: outputs
- mountPath: /app/outputs
- resources:
- requests:
- memory: "1Gi"
- cpu: "500m"
- limits:
- memory: "2Gi"
- cpu: "1"
- securityContext:
- runAsNonRoot: true
- runAsUser: 1000
- allowPrivilegeEscalation: false
- volumes:
- - name: outputs
- persistentVolumeClaim:
- claimName: ad-outputs-pvc
|