| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- # ==========================================
- # 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
|