values.yaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. # ==========================================
  2. # Helm Values - shop-recycle
  3. # 全局配置(所有环境共享)
  4. # ==========================================
  5. # 全局配置
  6. global:
  7. imagePullSecrets: []
  8. # - name: aliyun-registry
  9. # 副本数
  10. replicaCount: 2
  11. # 镜像配置
  12. image:
  13. registry: docker.io
  14. namespace: shop-recycle
  15. pullPolicy: IfNotPresent
  16. # tag由Jenkins Pipeline动态注入(--set image.tag=xxx)
  17. # 环境名称(由Pipeline动态注入)
  18. environment: dev
  19. # ==========================================
  20. # Gateway (API网关)
  21. # ==========================================
  22. gateway:
  23. enabled: true
  24. replicaCount: 2
  25. image:
  26. name: gateway
  27. # tag由全局image.tag继承
  28. port: 8080
  29. containerPort: 8080
  30. protocol: TCP
  31. resources:
  32. requests:
  33. memory: "256Mi"
  34. cpu: "250m"
  35. limits:
  36. memory: "512Mi"
  37. cpu: "500m"
  38. # JVM参数
  39. javaOpts: "-Xms256m -Xmx512m -XX:+UseG1GC"
  40. # Spring Profiles
  41. springProfiles: "kubernetes"
  42. # 健康检查
  43. livenessProbe:
  44. httpGet:
  45. path: /health
  46. port: 8080
  47. initialDelaySeconds: 30
  48. periodSeconds: 10
  49. timeoutSeconds: 5
  50. failureThreshold: 3
  51. readinessProbe:
  52. httpGet:
  53. path: /health
  54. port: 8080
  55. initialDelaySeconds: 20
  56. periodSeconds: 5
  57. timeoutSeconds: 3
  58. failureThreshold: 3
  59. # 服务配置
  60. service:
  61. type: ClusterIP
  62. port: 8080
  63. targetPort: 8080
  64. annotations: {}
  65. # 入口配置
  66. ingress:
  67. enabled: false
  68. className: "nginx"
  69. annotations:
  70. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  71. hosts:
  72. - host: "gateway.example.com"
  73. paths:
  74. - path: /
  75. pathType: Prefix
  76. tls:
  77. - secretName: gateway-tls
  78. hosts:
  79. - "gateway.example.com"
  80. # 环境变量
  81. env:
  82. SPRING_CLOUD_CONFIG_ENABLED: "true"
  83. LOGGING_LEVEL_ROOT: "INFO"
  84. # ConfigMap数据
  85. configMap:
  86. application.yml: |
  87. spring:
  88. cloud:
  89. gateway:
  90. routes:
  91. - id: order-service
  92. uri: http://shop-recycle-order-service:8081
  93. predicates:
  94. - Path=/api/order/**
  95. - id: payment-service
  96. uri: http://shop-recycle-payment-service:8082
  97. predicates:
  98. - Path=/api/payment/**
  99. - id: test-order
  100. uri: http://shop-recycle-order-service:8081
  101. predicates:
  102. - Path=/api/test/**
  103. - id: test-payment
  104. uri: http://shop-recycle-payment-service:8082
  105. predicates:
  106. - Path=/api/test/**
  107. management:
  108. endpoints:
  109. web:
  110. exposure:
  111. include: health,info
  112. # ==========================================
  113. # Order Service (订单服务)
  114. # ==========================================
  115. orderService:
  116. enabled: true
  117. replicaCount: 2
  118. image:
  119. name: order-service
  120. port: 8081
  121. containerPort: 8081
  122. protocol: TCP
  123. resources:
  124. requests:
  125. memory: "256Mi"
  126. cpu: "250m"
  127. limits:
  128. memory: "512Mi"
  129. cpu: "500m"
  130. javaOpts: "-Xms256m -Xmx512m -XX:+UseG1GC"
  131. springProfiles: "kubernetes"
  132. livenessProbe:
  133. httpGet:
  134. path: /health
  135. port: 8081
  136. initialDelaySeconds: 30
  137. periodSeconds: 10
  138. timeoutSeconds: 5
  139. failureThreshold: 3
  140. readinessProbe:
  141. httpGet:
  142. path: /health
  143. port: 8081
  144. initialDelaySeconds: 20
  145. periodSeconds: 5
  146. timeoutSeconds: 3
  147. failureThreshold: 3
  148. service:
  149. type: ClusterIP
  150. port: 8081
  151. targetPort: 8081
  152. annotations: {}
  153. env:
  154. SPRING_CLOUD_CONFIG_ENABLED: "true"
  155. LOGGING_LEVEL_ROOT: "INFO"
  156. # ==========================================
  157. # Payment Service (支付服务)
  158. # ==========================================
  159. paymentService:
  160. enabled: true
  161. replicaCount: 2
  162. image:
  163. name: payment-service
  164. port: 8082
  165. containerPort: 8082
  166. protocol: TCP
  167. resources:
  168. requests:
  169. memory: "256Mi"
  170. cpu: "250m"
  171. limits:
  172. memory: "512Mi"
  173. cpu: "500m"
  174. javaOpts: "-Xms256m -Xmx512m -XX:+UseG1GC"
  175. springProfiles: "kubernetes"
  176. livenessProbe:
  177. httpGet:
  178. path: /health
  179. port: 8082
  180. initialDelaySeconds: 30
  181. periodSeconds: 10
  182. timeoutSeconds: 5
  183. failureThreshold: 3
  184. readinessProbe:
  185. httpGet:
  186. path: /health
  187. port: 8082
  188. initialDelaySeconds: 20
  189. periodSeconds: 5
  190. timeoutSeconds: 3
  191. failureThreshold: 3
  192. service:
  193. type: ClusterIP
  194. port: 8082
  195. targetPort: 8082
  196. annotations: {}
  197. env:
  198. SPRING_CLOUD_CONFIG_ENABLED: "true"
  199. LOGGING_LEVEL_ROOT: "INFO"
  200. # ==========================================
  201. # 网络策略
  202. # ==========================================
  203. networkPolicy:
  204. enabled: false
  205. policyTypes:
  206. - Ingress
  207. - Egress
  208. # ==========================================
  209. # Pod安全策略
  210. # ==========================================
  211. podSecurityPolicy:
  212. enabled: false
  213. # ==========================================
  214. # RBAC配置
  215. # ==========================================
  216. rbac:
  217. create: true
  218. # 指定已有的ServiceAccount
  219. serviceAccountName: ""
  220. # ==========================================
  221. # 节点亲和性与污点容限
  222. # ==========================================
  223. affinity:
  224. podAntiAffinity:
  225. preferredDuringSchedulingIgnoredDuringExecution:
  226. - weight: 100
  227. podAffinityTerm:
  228. labelSelector:
  229. matchExpressions:
  230. - key: app
  231. operator: In
  232. values:
  233. - shop-recycle-gateway
  234. topologyKey: kubernetes.io/hostname
  235. tolerations: []
  236. # ==========================================
  237. # 监控和日志
  238. # ==========================================
  239. monitoring:
  240. enabled: false
  241. # Prometheus ServiceMonitor
  242. serviceMonitor:
  243. enabled: false
  244. interval: 30s
  245. logging:
  246. # 日志级别
  247. level: INFO
  248. # 日志输出格式
  249. format: json