pouchlab.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. apiVersion: v1
  2. kind: Namespace
  3. metadata:
  4. name: pouchlab
  5. labels:
  6. app.kubernetes.io/name: pouchlab
  7. ---
  8. apiVersion: apps/v1
  9. kind: Deployment
  10. metadata:
  11. name: pouchlab
  12. namespace: pouchlab
  13. labels:
  14. app: pouchlab
  15. spec:
  16. # SQLite 单写者:固定 1 副本(数据卷 hostPath)
  17. replicas: 1
  18. revisionHistoryLimit: 3
  19. selector:
  20. matchLabels:
  21. app: pouchlab
  22. strategy:
  23. type: RollingUpdate
  24. rollingUpdate:
  25. maxSurge: 1
  26. maxUnavailable: 0
  27. template:
  28. metadata:
  29. labels:
  30. app: pouchlab
  31. spec:
  32. nodeSelector:
  33. kubernetes.io/hostname: k8s-node1 # 数据 hostPath 固定节点(SQLite 单副本)
  34. containers:
  35. - name: pouchlab
  36. image: k8s.device.wenhq.top:8583/docker_r/pouchlab:1.8.28
  37. # Always:同 tag 覆盖推送后,rollout restart 可强制拉新镜像
  38. imagePullPolicy: Always
  39. env:
  40. - name: PL_DB_HOST
  41. value: pouchlab-mysql.pouchlab.svc.cluster.local
  42. - name: PL_DB_PORT
  43. value: "3306"
  44. - name: PL_DB_USER
  45. value: pouchlab
  46. - name: PL_DB_PASSWORD
  47. value: pouchlab-db-2026
  48. - name: PL_DB_NAME
  49. value: pouchlab
  50. - name: PL_REDIS_URL
  51. value: redis://pouchlab-redis.pouchlab.svc.cluster.local:6379/0
  52. # 邮件:Resend(优先),域名 steadypackaging.com 需在 Resend 后台验证
  53. - name: PL_RESEND_API_KEY
  54. valueFrom:
  55. secretKeyRef:
  56. name: pouchlab-mail
  57. key: resend-api-key
  58. - name: PL_MAIL_FROM
  59. value: mail@steadypackaging.com
  60. ports:
  61. - name: http
  62. containerPort: 8080
  63. resources:
  64. requests:
  65. cpu: 100m
  66. memory: 128Mi
  67. limits:
  68. cpu: 500m
  69. memory: 384Mi
  70. readinessProbe:
  71. httpGet:
  72. path: /healthz
  73. port: 8080
  74. initialDelaySeconds: 5
  75. periodSeconds: 5
  76. livenessProbe:
  77. httpGet:
  78. path: /healthz
  79. port: 8080
  80. initialDelaySeconds: 15
  81. periodSeconds: 20
  82. volumeMounts:
  83. - name: data
  84. mountPath: /app/data
  85. volumes:
  86. - name: data
  87. hostPath:
  88. path: /data/pouchlab
  89. type: DirectoryOrCreate
  90. ---
  91. apiVersion: v1
  92. kind: Service
  93. metadata:
  94. name: pouchlab
  95. namespace: pouchlab
  96. labels:
  97. app: pouchlab
  98. spec:
  99. type: NodePort
  100. selector:
  101. app: pouchlab
  102. ports:
  103. - name: http
  104. port: 8080
  105. targetPort: 8080
  106. nodePort: 30080