configmap-gateway.yaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. main:
  14. web-application-type: reactive
  15. application:
  16. name: shop-recycle-gateway
  17. cloud:
  18. gateway:
  19. routes:
  20. - id: order-service
  21. uri: http://{{ include "shop-recycle.fullname" . }}-order-service:{{ .Values.orderService.service.port }}
  22. predicates:
  23. - Path=/api/order/**
  24. filters:
  25. - RewritePath=/api/order(?<segment>.*), /api$\{segment}
  26. - id: payment-service
  27. uri: http://{{ include "shop-recycle.fullname" . }}-payment-service:{{ .Values.paymentService.service.port }}
  28. predicates:
  29. - Path=/api/payment/**
  30. filters:
  31. - RewritePath=/api/payment(?<segment>.*), /api$\{segment}
  32. - id: test-order
  33. uri: http://{{ include "shop-recycle.fullname" . }}-order-service:{{ .Values.orderService.service.port }}
  34. predicates:
  35. - Path=/api/test/order/**
  36. filters:
  37. - RewritePath=/api/test/order(?<segment>.*), /test$\{segment}
  38. - id: test-payment
  39. uri: http://{{ include "shop-recycle.fullname" . }}-payment-service:{{ .Values.paymentService.service.port }}
  40. predicates:
  41. - Path=/api/test/payment/**
  42. filters:
  43. - RewritePath=/api/test/payment(?<segment>.*), /test$\{segment}
  44. management:
  45. endpoints:
  46. web:
  47. exposure:
  48. include: health,info,metrics
  49. metrics:
  50. export:
  51. prometheus:
  52. enabled: true
  53. endpoint:
  54. health:
  55. show-details: when-authorized
  56. logging:
  57. level:
  58. root: {{ .Values.logging.level }}
  59. com.shop.recycle: DEBUG
  60. pattern:
  61. console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
  62. {{- end }}