# ========================================== # Helm Values - shop-recycle # 全局配置(所有环境共享) # ========================================== # 全局配置 global: imagePullSecrets: [] # - name: aliyun-registry # 副本数 replicaCount: 2 # 镜像配置 image: registry: docker.io namespace: shop-recycle pullPolicy: IfNotPresent # tag由Jenkins Pipeline动态注入(--set image.tag=xxx) # 环境名称(由Pipeline动态注入) environment: dev # ========================================== # Gateway (API网关) # ========================================== gateway: enabled: true replicaCount: 2 image: name: gateway # tag由全局image.tag继承 port: 8080 containerPort: 8080 protocol: TCP resources: requests: memory: "256Mi" cpu: "250m" limits: memory: "512Mi" cpu: "500m" # JVM参数 javaOpts: "-Xms256m -Xmx512m -XX:+UseG1GC" # Spring Profiles springProfiles: "kubernetes" # 健康检查 livenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 20 periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 3 # 服务配置 service: type: ClusterIP port: 8080 targetPort: 8080 annotations: {} # 入口配置 ingress: enabled: false className: "nginx" annotations: cert-manager.io/cluster-issuer: "letsencrypt-prod" hosts: - host: "gateway.example.com" paths: - path: / pathType: Prefix tls: - secretName: gateway-tls hosts: - "gateway.example.com" # 环境变量 env: SPRING_CLOUD_CONFIG_ENABLED: "true" LOGGING_LEVEL_ROOT: "INFO" # ConfigMap数据 configMap: application.yml: | spring: cloud: gateway: routes: - id: order-service uri: http://shop-recycle-order-service:8081 predicates: - Path=/api/order/** - id: payment-service uri: http://shop-recycle-payment-service:8082 predicates: - Path=/api/payment/** - id: test-order uri: http://shop-recycle-order-service:8081 predicates: - Path=/api/test/** - id: test-payment uri: http://shop-recycle-payment-service:8082 predicates: - Path=/api/test/** management: endpoints: web: exposure: include: health,info # ========================================== # Order Service (订单服务) # ========================================== orderService: enabled: true replicaCount: 2 image: name: order-service port: 8081 containerPort: 8081 protocol: TCP resources: requests: memory: "256Mi" cpu: "250m" limits: memory: "512Mi" cpu: "500m" javaOpts: "-Xms256m -Xmx512m -XX:+UseG1GC" springProfiles: "kubernetes" livenessProbe: httpGet: path: /health port: 8081 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: httpGet: path: /health port: 8081 initialDelaySeconds: 20 periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 3 service: type: ClusterIP port: 8081 targetPort: 8081 annotations: {} env: SPRING_CLOUD_CONFIG_ENABLED: "true" LOGGING_LEVEL_ROOT: "INFO" # ========================================== # Payment Service (支付服务) # ========================================== paymentService: enabled: true replicaCount: 2 image: name: payment-service port: 8082 containerPort: 8082 protocol: TCP resources: requests: memory: "256Mi" cpu: "250m" limits: memory: "512Mi" cpu: "500m" javaOpts: "-Xms256m -Xmx512m -XX:+UseG1GC" springProfiles: "kubernetes" livenessProbe: httpGet: path: /health port: 8082 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: httpGet: path: /health port: 8082 initialDelaySeconds: 20 periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 3 service: type: ClusterIP port: 8082 targetPort: 8082 annotations: {} env: SPRING_CLOUD_CONFIG_ENABLED: "true" LOGGING_LEVEL_ROOT: "INFO" # ========================================== # 网络策略 # ========================================== networkPolicy: enabled: false policyTypes: - Ingress - Egress # ========================================== # Pod安全策略 # ========================================== podSecurityPolicy: enabled: false # ========================================== # RBAC配置 # ========================================== rbac: create: true # 指定已有的ServiceAccount serviceAccountName: "" # ========================================== # 节点亲和性与污点容限 # ========================================== affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - shop-recycle-gateway topologyKey: kubernetes.io/hostname tolerations: [] # ========================================== # 监控和日志 # ========================================== monitoring: enabled: false # Prometheus ServiceMonitor serviceMonitor: enabled: false interval: 30s logging: # 日志级别 level: INFO # 日志输出格式 format: json