From 2f01f7194e8c31faa29321b9d9ce6e7161844606 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 24 Mar 2022 00:51:45 +0300 Subject: [PATCH 1/3] updated gateway-web-public --- .../gateway-web-public-configmap.yaml | 165 ++++++++++-------- .../gateway-web-public-deployment.yaml | 4 +- .../charts/gateway-web-public/values.yaml | 26 +-- 3 files changed, 107 insertions(+), 88 deletions(-) diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml index 063c415f..d0548b41 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml @@ -3,75 +3,104 @@ kind: ConfigMap metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap data: - ocelot.json: |- + yarp.json: |- { - "GlobalConfiguration": { - "BaseUrl": "{{ .Values.config.globalConfigurationBaseUrl }}" - }, - "Routes": [ - { - "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 }}", - } - ], - "UpstreamPathTemplate": "/api/abp/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Catalog Service", - "DownstreamPathTemplate": "/api/catalog/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.catalogService.schema }}", - "DownstreamHostAndPorts": [ - { - "Host": "{{ .Values.reRoutes.catalogService.host }}", - "Port": "{{ .Values.reRoutes.catalogService.port }}", - } - ], - "UpstreamPathTemplate": "/api/c/catalog/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Basket Service", - "DownstreamPathTemplate": "/api/basket/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.basketService.schema }}", - "DownstreamHostAndPorts": [ - { - "Host": "{{ .Values.reRoutes.basketService.host }}", - "Port": "{{ .Values.reRoutes.basketService.port }}", + "ReverseProxy": { + "Routes": { + "Account Service": { + "ClusterId": "account-cluster", + "Match": { + "Path": "/api/account/{**everything}" + } + }, + "Administration Service": { + "ClusterId": "administration-cluster", + "Match": { + "Path": "/api/abp/{**everything}" + } + }, + "Catalog Service": { + "ClusterId": "catalog-cluster", + "Match": { + "Path": "/api/catalog/{**everything}" + } + }, + "Basket Service": { + "ClusterId": "basket-cluster", + "Match": { + "Path": "/api/basket/{**everything}" + } + }, + "Ordering Service": { + "ClusterId": "ordering-cluster", + "Match": { + "Path": "/api/ordering/{**everything}" + } + }, + "Payment Service": { + "ClusterId": "payment-cluster", + "Match": { + "Path": "/api/payment/{**everything}" + } + }, + "product-picture-route": { + "ClusterId": "product-picture-cluster", + "Match": { + "Path": "/product-images/{**everything}", + "Methods" : [ "GET" ] + } } - ], - "UpstreamPathTemplate": "/api/basket/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }, - { - "ServiceKey": "Ordering Service", - "DownstreamPathTemplate": "/api/ordering/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.orderingService.schema }}", - "DownstreamHostAndPorts": [ - { - "Host": "{{ .Values.reRoutes.orderingService.host }}", - "Port": "{{ .Values.reRoutes.orderingService.port }}", + }, + "Clusters": { + "account-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.accountService.url }}" + } + } + }, + "administration-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.administrationService.url }}" + } + } + }, + "catalog-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.catalogService.url }}" + } + } + }, + "product-picture-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.catalogService.url }}" + } + } + }, + "basket-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.basketService.url }}" + } + } + }, + "ordering-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.orderingService.url }}" + } + } + }, + "payment-cluster": { + "Destinations": { + "destination1": { + "Address": "{{ .Values.reRoutes.paymentService.url }}" + } + } } - ], - "UpstreamPathTemplate": "/api/ordering/{everything}", - "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] - }] + } + } } \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml index 59db1066..07cea6b6 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-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-public/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml index 745f8d01..c57f2199 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml @@ -14,29 +14,19 @@ config: 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 catalogService: - schema: http - host: eshop-st-catalog - port: 80 + url: http://eshop-st-catalog basketService: - schema: http - host: eshop-st-basket - port: 80 + url: http://eshop-st-basket orderingService: - schema: http - host: eshop-st-ordering - port: 80 + url: http://eshop-st-ordering + paymentService: + url: http://eshop-st-payment ingress: host: eshop-st-gateway-web-public From 34f740d30bf5e0c64dd04512d70982a6b6eb496c Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 24 Mar 2022 00:51:57 +0300 Subject: [PATCH 2/3] updateg gateway-web --- .../templates/gateway-web-configmap.yaml | 164 +++++++++--------- .../templates/gateway-web-deployment.yaml | 4 +- .../eshoponabp/charts/gateway-web/values.yaml | 12 +- 3 files changed, 88 insertions(+), 92 deletions(-) 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 From 12052184f21fbabcf6d331cee2ef505a555aaf54 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 24 Mar 2022 00:52:06 +0300 Subject: [PATCH 3/3] updated values --- etc/k8s/eshoponabp/values.yaml | 36 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 7560543a..b3c350d8 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -130,14 +130,12 @@ gateway-web: repository: "eshoponabp/gateway-web" tag: latest reRoutes: + accountService: + 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 # gateway-web-public sub-chart override gateway-web-public: @@ -161,29 +159,19 @@ gateway-web-public: tag: latest 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 catalogService: - schema: http - host: eshop-st-catalog - port: 80 + url: http://eshop-st-catalog basketService: - schema: http - host: eshop-st-basket - port: 80 + url: http://eshop-st-basket orderingService: - schema: http - host: eshop-st-ordering - port: 80 + url: http://eshop-st-ordering + paymentService: + url: http://eshop-st-payment # basket-service sub-chart override basket: