diff --git a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml index 52e6bd5e..5d905823 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml @@ -3,88 +3,90 @@ kind: ConfigMap metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap data: - ocelot.json: |- + yarp.json: |- { - "GlobalConfiguration": { - "BaseUrl": "{{ .Values.config.globalConfigurationBaseUrl }}" - }, - "Routes": [ - { - "ServiceKey": "Identity Service", - "DownstreamPathTemplate": "/api/identity/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.identityService.schema }}", - "DownstreamHostAndPorts": [ - { - "Host": "{{ .Values.reRoutes.identityService.host }}", - "Port": {{ .Values.reRoutes.identityService.port }} - } - ], - "UpstreamPathTemplate": "/api/identity/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Account Service", - "DownstreamPathTemplate": "/api/account/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.accountService.schema }}", - "DownstreamHostAndPorts": [ - { - "Host": "{{ .Values.reRoutes.accountService.host }}", - "Port": {{ .Values.reRoutes.accountService.port }} - } - ], - "UpstreamPathTemplate": "/api/account/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Administration Service", - "DownstreamPathTemplate": "/api/abp/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.administrationService.schema }}", - "DownstreamHostAndPorts": [ - { - "Host": "{{ .Values.reRoutes.administrationService.host }}", - "Port": "{{ .Values.reRoutes.administrationService.port }}", + "ReverseProxy": { + "Routes": { + "Account Service": { + "ClusterId": "account-cluster", + "Match": { + "Path": "/api/account/{**everything}" + } + }, + "Identity Service": { + "ClusterId": "identity-cluster", + "Match": { + "Path": "/api/identity/{**everything}" + } + }, + "Administration Service": { + "ClusterId": "administration-cluster", + "Match": { + "Path": "/api/abp/{**everything}" + } + }, + "feature-management-route": { + "ClusterId": "feature-management-cluster", + "Match": { + "Path": "/api/feature-management/{**everything}" + } + }, + "permission-management-route": { + "ClusterId": "permission-management-cluster", + "Match": { + "Path": "/api/permission-management/{**everything}" + } + }, + "setting-management-route": { + "ClusterId": "setting-management-cluster", + "Match": { + "Path": "/api/setting-management/{**everything}" + } } - ], - "UpstreamPathTemplate": "/api/abp/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Administration Service", - "DownstreamPathTemplate": "/api/feature-management/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.administrationService.schema }}", - "DownstreamHostAndPorts": [ - { - "Host": "{{ .Values.reRoutes.administrationService.host }}", - "Port": "{{ .Values.reRoutes.administrationService.port }}", - } - ], - "UpstreamPathTemplate": "/api/feature-management/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Administration Service", - "DownstreamPathTemplate": "/api/permission-management/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.administrationService.schema }}", - "DownstreamHostAndPorts": [ - { - "Host": "{{ .Values.reRoutes.administrationService.host }}", - "Port": "{{ .Values.reRoutes.administrationService.port }}", - } - ], - "UpstreamPathTemplate": "/api/permission-management/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Administration Service", - "DownstreamPathTemplate": "/api/setting-management/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.administrationService.schema }}", - "DownstreamHostAndPorts": [ - { - "Host": "{{ .Values.reRoutes.administrationService.host }}", - "Port": "{{ .Values.reRoutes.administrationService.port }}", + }, + "Clusters": { + "account-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.accountService.url }}" + } + } + }, + "identity-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.identityService.url }}" + } + } + }, + "administration-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.administrationService.url }}" + } + } + }, + "feature-management-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.administrationService.url }}" + } + } + }, + "permission-management-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.administrationService.url }}" + } + } + }, + "setting-management-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.administrationService.url }}" + } + } } - ], - "UpstreamPathTemplate": "/api/setting-management/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }] + } + } } \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml index cf3a8a1b..81fb46d7 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml @@ -22,8 +22,8 @@ spec: containerPort: 443 volumeMounts: - name: config-volume - mountPath: /app/ocelot.json - subPath: ocelot.json + mountPath: /app/yarp.json + subPath: yarp.json env: - name: App__SelfUrl value: "{{ .Values.config.selfUrl }}" diff --git a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml index 66d13b0b..c52bfe5a 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml @@ -14,17 +14,11 @@ config: stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 reRoutes: accountService: - schema: http - host: eshop-st-authserver - port: 80 + url: http://eshop-st-authserver identityService: - schema: http - host: eshop-st-identity - port: 80 + url: http://eshop-st-identity administrationService: - schema: http - host: eshop-st-administration - port: 80 + url: http://eshop-st-administration ingress: host: # eshop-st-gateway-web tlsSecret: eshop-demo-tls