values-prod.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # ==========================================
  2. # Helm Values - shop-recycle (PROD环境)
  3. # 生产环境配置(高可用、安全)
  4. # ==========================================
  5. environment: prod
  6. replicaCount: 3
  7. gateway:
  8. replicaCount: 3
  9. resources:
  10. requests:
  11. memory: "1Gi"
  12. cpu: "1000m"
  13. limits:
  14. memory: "2Gi"
  15. cpu: "2000m"
  16. javaOpts: "-Xms1g -Xmx2g -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+ParallelRefProcEnabled"
  17. livenessProbe:
  18. httpGet:
  19. path: /health
  20. port: 8080
  21. initialDelaySeconds: 60
  22. periodSeconds: 10
  23. timeoutSeconds: 5
  24. failureThreshold: 3
  25. readinessProbe:
  26. httpGet:
  27. path: /health
  28. port: 8080
  29. initialDelaySeconds: 30
  30. periodSeconds: 5
  31. timeoutSeconds: 3
  32. failureThreshold: 2
  33. ingress:
  34. enabled: true
  35. className: "nginx"
  36. annotations:
  37. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  38. nginx.ingress.kubernetes.io/ssl-redirect: "true"
  39. nginx.ingress.kubernetes.io/rate-limit: "500"
  40. nginx.ingress.kubernetes.io/auth-type: "basic"
  41. # nginx.ingress.kubernetes.io/auth-secret: "basic-auth"
  42. # nginx.ingress.kubernetes.io/auth-realm: "Authentication Required"
  43. hosts:
  44. - host: "gateway.example.com"
  45. paths:
  46. - path: /
  47. pathType: Prefix
  48. - host: "api.example.com"
  49. paths:
  50. - path: /
  51. pathType: Prefix
  52. tls:
  53. - secretName: gateway-tls-prod
  54. hosts:
  55. - "gateway.example.com"
  56. - "api.example.com"
  57. orderService:
  58. replicaCount: 3
  59. resources:
  60. requests:
  61. memory: "1Gi"
  62. cpu: "1000m"
  63. limits:
  64. memory: "2Gi"
  65. cpu: "2000m"
  66. paymentService:
  67. replicaCount: 3
  68. resources:
  69. requests:
  70. memory: "1Gi"
  71. cpu: "1000m"
  72. limits:
  73. memory: "2Gi"
  74. cpu: "2000m"
  75. # 生产级安全配置
  76. networkPolicy:
  77. enabled: true
  78. policyTypes:
  79. - Ingress
  80. - Egress
  81. podSecurityPolicy:
  82. enabled: true
  83. rbac:
  84. create: true
  85. # 节点亲和性 - 使用专用节点池
  86. affinity:
  87. nodeAffinity:
  88. requiredDuringSchedulingIgnoredDuringExecution:
  89. nodeSelectorTerms:
  90. - matchExpressions:
  91. - key: node-role.kubernetes.io/application
  92. operator: In
  93. values:
  94. - "true"
  95. podAntiAffinity:
  96. requiredDuringSchedulingIgnoredDuringExecution:
  97. - labelSelector:
  98. matchExpressions:
  99. - key: app
  100. operator: In
  101. values:
  102. - shop-recycle-gateway
  103. topologyKey: kubernetes.io/hostname
  104. tolerations:
  105. - key: "production"
  106. operator: "Equal"
  107. value: "true"
  108. effect: "NoSchedule"
  109. # 监控和日志
  110. monitoring:
  111. enabled: true
  112. serviceMonitor:
  113. enabled: true
  114. interval: 15s
  115. logging:
  116. level: WARN
  117. format: json