apiVersion: v1 kind: Namespace metadata: name: pouchlab labels: app.kubernetes.io/name: pouchlab --- apiVersion: apps/v1 kind: Deployment metadata: name: pouchlab namespace: pouchlab labels: app: pouchlab spec: # SQLite 单写者:固定 1 副本(数据卷 hostPath) replicas: 1 revisionHistoryLimit: 3 selector: matchLabels: app: pouchlab strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 template: metadata: labels: app: pouchlab spec: nodeSelector: kubernetes.io/hostname: k8s-node1 # 数据 hostPath 固定节点(SQLite 单副本) containers: - name: pouchlab image: k8s.device.wenhq.top:8583/docker_r/pouchlab:1.8.28 # Always:同 tag 覆盖推送后,rollout restart 可强制拉新镜像 imagePullPolicy: Always env: - name: PL_DB_HOST value: pouchlab-mysql.pouchlab.svc.cluster.local - name: PL_DB_PORT value: "3306" - name: PL_DB_USER value: pouchlab - name: PL_DB_PASSWORD value: pouchlab-db-2026 - name: PL_DB_NAME value: pouchlab - name: PL_REDIS_URL value: redis://pouchlab-redis.pouchlab.svc.cluster.local:6379/0 # 邮件:Resend(优先),域名 steadypackaging.com 需在 Resend 后台验证 - name: PL_RESEND_API_KEY valueFrom: secretKeyRef: name: pouchlab-mail key: resend-api-key - name: PL_MAIL_FROM value: mail@steadypackaging.com ports: - name: http containerPort: 8080 resources: requests: cpu: 100m memory: 128Mi limits: cpu: 500m memory: 384Mi readinessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 5 periodSeconds: 5 livenessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 15 periodSeconds: 20 volumeMounts: - name: data mountPath: /app/data volumes: - name: data hostPath: path: /data/pouchlab type: DirectoryOrCreate --- apiVersion: v1 kind: Service metadata: name: pouchlab namespace: pouchlab labels: app: pouchlab spec: type: NodePort selector: app: pouchlab ports: - name: http port: 8080 targetPort: 8080 nodePort: 30080