# ========================================================= # Arcticnewone 生产部署 - Deployment # # 镜像: 由 deploy.sh 渲染,占位 __IMAGE__ 替换为 # swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:<版本号> # 副本数: 1(团队规范) # # 敏感配置(SESSION_SECRET / SMTP_* / CONTACT_TO / ADMIN_EMAILS) # 由 deploy.sh 以 Secret `app-secrets` 注入;公开配置(站点地址/DB 路径) # 以 ConfigMap `app-config` 注入。数据库持久化到 PVC `arcticnewone-data`(/data)。 # ========================================================= apiVersion: apps/v1 kind: Deployment metadata: name: arcticnewone namespace: arcticnewone labels: app: arcticnewone spec: # RWO PVC 单副本场景:Recreate 策略避免滚动更新时新旧 Pod 争用卷导致死锁 strategy: type: Recreate replicas: 1 selector: matchLabels: app: arcticnewone template: metadata: labels: app: arcticnewone spec: imagePullSecrets: - name: huawei-swr-secret containers: - name: arcticnewone image: __IMAGE__ imagePullPolicy: IfNotPresent ports: - name: http containerPort: 3000 env: - name: NODE_ENV value: "production" - name: HOST value: "0.0.0.0" - name: PORT value: "3000" envFrom: - configMapRef: name: app-config - secretRef: name: app-secrets volumeMounts: - name: data mountPath: /data resources: requests: cpu: 100m memory: 128Mi limits: cpu: 500m memory: 512Mi readinessProbe: httpGet: path: / port: 3000 initialDelaySeconds: 5 periodSeconds: 10 timeoutSeconds: 3 failureThreshold: 3 livenessProbe: httpGet: path: / port: 3000 initialDelaySeconds: 15 periodSeconds: 20 timeoutSeconds: 3 failureThreshold: 3 volumes: - name: data persistentVolumeClaim: claimName: arcticnewone-data