| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- 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.25
- # 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
|