apiVersion: apps/v1 kind: Deployment metadata: name: auto-put-ad-mini namespace: ad-automation labels: app: auto-put-ad-mini version: v1.0.0 spec: replicas: 1 # 单实例运行(避免并发冲突) selector: matchLabels: app: auto-put-ad-mini template: metadata: labels: app: auto-put-ad-mini version: v1.0.0 spec: containers: - name: decision-engine image: your-registry/auto-put-ad-mini:latest imagePullPolicy: Always ports: - containerPort: 8080 name: http protocol: TCP envFrom: - configMapRef: name: ad-config - secretRef: name: ad-secrets env: - name: CRON_SCHEDULE value: "0 2 * * *" # 每天凌晨2点UTC - name: RUN_ON_STARTUP value: "false" # 启动时不立即执行 - name: PORT value: "8080" volumeMounts: - name: outputs mountPath: /app/outputs livenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 30 periodSeconds: 30 timeoutSeconds: 10 failureThreshold: 3 readinessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 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 --- apiVersion: v1 kind: Service metadata: name: auto-put-ad-mini namespace: ad-automation labels: app: auto-put-ad-mini spec: selector: app: auto-put-ad-mini ports: - name: http port: 8080 targetPort: 8080 protocol: TCP type: ClusterIP