# ========================================================= # Arcticnewone 生产部署 - Deployment # # 镜像: 华为云 SWR swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest # 副本数: 1(团队规范) # # 私有镜像拉取说明: # 集群中需预先创建 docker-registry 类型的 Secret(凭据从环境变量读取,不写入仓库): # kubectl create secret docker-registry huawei-swr-secret \ # --docker-server="$SWR_REGISTRY" \ # --docker-username="$SWR_USERNAME" \ # --docker-password="$SWR_PASSWORD" \ # --dry-run=client -o yaml | kubectl apply -f - # 详见 deploy/README.md # ========================================================= apiVersion: apps/v1 kind: Deployment metadata: name: arcticnewone namespace: arcticnewone labels: app: arcticnewone spec: replicas: 1 selector: matchLabels: app: arcticnewone template: metadata: labels: app: arcticnewone spec: imagePullSecrets: - name: huawei-swr-secret containers: - name: arcticnewone image: swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest imagePullPolicy: Always ports: - name: http containerPort: 3000 env: - name: NODE_ENV value: "production" - name: HOST value: "0.0.0.0" - name: PORT value: "3000" # 数据库连接(必填) - name: NUXT_DATABASE_URL valueFrom: secretKeyRef: name: arcticnewone-secrets key: database-url # JWT 签名密钥(必填) - name: NUXT_JWT_SECRET valueFrom: secretKeyRef: name: arcticnewone-secrets key: jwt-secret # SMTP 邮件通知(可选;不配置时表单/订阅仅入库) - name: NUXT_SMTP_HOST valueFrom: secretKeyRef: name: arcticnewone-secrets key: smtp-host optional: true - name: NUXT_SMTP_PORT valueFrom: secretKeyRef: name: arcticnewone-secrets key: smtp-port optional: true - name: NUXT_SMTP_USER valueFrom: secretKeyRef: name: arcticnewone-secrets key: smtp-user optional: true - name: NUXT_SMTP_PASS valueFrom: secretKeyRef: name: arcticnewone-secrets key: smtp-pass optional: true - name: NUXT_SMTP_FROM valueFrom: secretKeyRef: name: arcticnewone-secrets key: smtp-from optional: true - name: NUXT_SMTP_CONTACT_TO valueFrom: secretKeyRef: name: arcticnewone-secrets key: smtp-contact-to optional: true 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