configmap-gateway.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {{- if .Values.gateway.enabled }}
  2. apiVersion: v1
  3. kind: ConfigMap
  4. metadata:
  5. name: {{ include "shop-recycle.fullname" . }}-gateway-config
  6. labels:
  7. app: {{ include "shop-recycle.fullname" . }}-gateway
  8. {{- include "shop-recycle.labels" . | nindent 4 }}
  9. namespace: {{ .Release.Namespace }}
  10. data:
  11. application.yml: |
  12. spring:
  13. application:
  14. name: shop-recycle-gateway
  15. cloud:
  16. gateway:
  17. routes:
  18. - id: order-service
  19. uri: http://{{ include "shop-recycle.fullname" . }}-order-service:{{ .Values.orderService.service.port }}
  20. predicates:
  21. - Path=/api/order/**
  22. filters:
  23. - RewritePath=/api/order(?<segment>.*), /api$\{segment}
  24. - id: payment-service
  25. uri: http://{{ include "shop-recycle.fullname" . }}-payment-service:{{ .Values.paymentService.service.port }}
  26. predicates:
  27. - Path=/api/payment/**
  28. filters:
  29. - RewritePath=/api/payment(?<segment>.*), /api$\{segment}
  30. - id: test-order
  31. uri: http://{{ include "shop-recycle.fullname" . }}-order-service:{{ .Values.orderService.service.port }}
  32. predicates:
  33. - Path=/api/test/order/**
  34. filters:
  35. - RewritePath=/api/test/order(?<segment>.*), /test$\{segment}
  36. - id: test-payment
  37. uri: http://{{ include "shop-recycle.fullname" . }}-payment-service:{{ .Values.paymentService.service.port }}
  38. predicates:
  39. - Path=/api/test/payment/**
  40. filters:
  41. - RewritePath=/api/test/payment(?<segment>.*), /test$\{segment}
  42. management:
  43. endpoints:
  44. web:
  45. exposure:
  46. include: health,info,metrics
  47. metrics:
  48. export:
  49. prometheus:
  50. enabled: true
  51. endpoint:
  52. health:
  53. show-details: when-authorized
  54. logging:
  55. level:
  56. root: {{ .Values.logging.level }}
  57. com.shop.recycle: DEBUG
  58. pattern:
  59. console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
  60. {{- end }}