pouchlab.yaml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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.22
  37. imagePullPolicy: IfNotPresent
  38. env:
  39. - name: PL_DB_HOST
  40. value: pouchlab-mysql.pouchlab.svc.cluster.local
  41. - name: PL_DB_PORT
  42. value: "3306"
  43. - name: PL_DB_USER
  44. value: pouchlab
  45. - name: PL_DB_PASSWORD
  46. value: pouchlab-db-2026
  47. - name: PL_DB_NAME
  48. value: pouchlab
  49. - name: PL_REDIS_URL
  50. value: redis://pouchlab-redis.pouchlab.svc.cluster.local:6379/0
  51. ports:
  52. - name: http
  53. containerPort: 8080
  54. resources:
  55. requests:
  56. cpu: 100m
  57. memory: 128Mi
  58. limits:
  59. cpu: 500m
  60. memory: 384Mi
  61. readinessProbe:
  62. httpGet:
  63. path: /healthz
  64. port: 8080
  65. initialDelaySeconds: 5
  66. periodSeconds: 5
  67. livenessProbe:
  68. httpGet:
  69. path: /healthz
  70. port: 8080
  71. initialDelaySeconds: 15
  72. periodSeconds: 20
  73. volumeMounts:
  74. - name: data
  75. mountPath: /app/data
  76. volumes:
  77. - name: data
  78. hostPath:
  79. path: /data/pouchlab
  80. type: DirectoryOrCreate
  81. ---
  82. apiVersion: v1
  83. kind: Service
  84. metadata:
  85. name: pouchlab
  86. namespace: pouchlab
  87. labels:
  88. app: pouchlab
  89. spec:
  90. type: NodePort
  91. selector:
  92. app: pouchlab
  93. ports:
  94. - name: http
  95. port: 8080
  96. targetPort: 8080
  97. nodePort: 30080