From e4df0336e58ee204f4b84dc7f03248606327bbfd Mon Sep 17 00:00:00 2001 From: eiximenis Date: Wed, 16 Oct 2019 10:26:43 +0200 Subject: [PATCH] Changes in compose config for docker-compose up running ok. Added volumes for data --- .../Envoy/config/mobilemarketing/envoy.yaml | 28 +++++++++- .../Envoy/config/mobileshopping/envoy.yaml | 54 ++++++++++++++---- .../Envoy/config/webmarketing/envoy.yaml | 32 +++++++++-- .../Envoy/config/webshopping/envoy.yaml | 56 +++++++++++++++---- src/docker-compose.override.yml | 40 +++++++++---- 5 files changed, 169 insertions(+), 41 deletions(-) diff --git a/src/ApiGateways/Envoy/config/mobilemarketing/envoy.yaml b/src/ApiGateways/Envoy/config/mobilemarketing/envoy.yaml index 324d903ab..54b1afa06 100644 --- a/src/ApiGateways/Envoy/config/mobilemarketing/envoy.yaml +++ b/src/ApiGateways/Envoy/config/mobilemarketing/envoy.yaml @@ -23,17 +23,39 @@ static_resources: domains: - "*" routes: - - match: + - name: "m-short" + match: prefix: "/m/" route: + auto_host_rewrite: true prefix_rewrite: "/marketing-api/" cluster: marketing - - match: + - name: "m-long" + match: prefix: "/marketing-api/" route: + auto_host_rewrite: true cluster: marketing http_filters: - - name: envoy.router + - name: envoy.router + access_log: + - name: envoy.file_access_log + filter: + not_health_check_filter: {} + config: + json_format: + time: "%START_TIME%" + protocol: "%PROTOCOL%" + duration: "%DURATION%" + request_method: "%REQ(:METHOD)%" + request_host: "%REQ(HOST)%" + path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" + response_flags: "%RESPONSE_FLAGS%" + route_name: "%ROUTE_NAME%" + upstream_host: "%UPSTREAM_HOST%" + upstream_cluster: "%UPSTREAM_CLUSTER%" + upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" + path: "/tmp/access.log" clusters: - name: marketing connect_timeout: 0.25s diff --git a/src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml b/src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml index 4d9f449cb..373806b06 100644 --- a/src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml +++ b/src/ApiGateways/Envoy/config/mobileshopping/envoy.yaml @@ -23,44 +23,76 @@ static_resources: domains: - "*" routes: - - match: + - name: "c-short" + match: prefix: "/c/" route: + auto_host_rewrite: true prefix_rewrite: "/catalog-api/" cluster: catalog - - match: + - name: "c-long" + match: prefix: "/catalog-api/" route: + auto_host_rewrite: true cluster: catalog - - match: + - name: "o-short" + match: prefix: "/o/" route: + auto_host_rewrite: true prefix_rewrite: "/ordering-api/" cluster: ordering - - match: + - name: "o-long" + match: prefix: "/ordering-api/" route: + auto_host_rewrite: true cluster: ordering - - match: + - name: "b-short" + match: prefix: "/b/" route: + auto_host_rewrite: true prefix_rewrite: "/basket-api/" cluster: basket - - match: + - name: "b-long" + match: prefix: "/basket-api/" route: + auto_host_rewrite: true cluster: basket - - match: + - name: "agg" + match: prefix: "/" route: + auto_host_rewrite: true prefix_rewrite: "/" cluster: shoppingagg http_filters: - name: envoy.router + access_log: + - name: envoy.file_access_log + filter: + not_health_check_filter: {} + config: + json_format: + time: "%START_TIME%" + protocol: "%PROTOCOL%" + duration: "%DURATION%" + request_method: "%REQ(:METHOD)%" + request_host: "%REQ(HOST)%" + path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" + response_flags: "%RESPONSE_FLAGS%" + route_name: "%ROUTE_NAME%" + upstream_host: "%UPSTREAM_HOST%" + upstream_cluster: "%UPSTREAM_CLUSTER%" + upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" + path: "/tmp/access.log" clusters: - name: shoppingagg connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: @@ -68,7 +100,7 @@ static_resources: port_value: 80 - name: catalog connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: @@ -76,7 +108,7 @@ static_resources: port_value: 80 - name: basket connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: @@ -84,7 +116,7 @@ static_resources: port_value: 80 - name: ordering connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: diff --git a/src/ApiGateways/Envoy/config/webmarketing/envoy.yaml b/src/ApiGateways/Envoy/config/webmarketing/envoy.yaml index 324d903ab..c6f3421de 100644 --- a/src/ApiGateways/Envoy/config/webmarketing/envoy.yaml +++ b/src/ApiGateways/Envoy/config/webmarketing/envoy.yaml @@ -23,21 +23,43 @@ static_resources: domains: - "*" routes: - - match: + - name: "m-short" + match: prefix: "/m/" route: + auto_host_rewrite: true prefix_rewrite: "/marketing-api/" cluster: marketing - - match: + - name: "m-long" + match: prefix: "/marketing-api/" route: + auto_host_rewrite: true cluster: marketing http_filters: - - name: envoy.router + - name: envoy.router + access_log: + - name: envoy.file_access_log + filter: + not_health_check_filter: {} + config: + json_format: + time: "%START_TIME%" + protocol: "%PROTOCOL%" + duration: "%DURATION%" + request_method: "%REQ(:METHOD)%" + request_host: "%REQ(HOST)%" + path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" + response_flags: "%RESPONSE_FLAGS%" + route_name: "%ROUTE_NAME%" + upstream_host: "%UPSTREAM_HOST%" + upstream_cluster: "%UPSTREAM_CLUSTER%" + upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" + path: "/tmp/access.log" clusters: - name: marketing connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: @@ -45,7 +67,7 @@ static_resources: port_value: 80 - name: locations connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: diff --git a/src/ApiGateways/Envoy/config/webshopping/envoy.yaml b/src/ApiGateways/Envoy/config/webshopping/envoy.yaml index 4d9f449cb..1491f37af 100644 --- a/src/ApiGateways/Envoy/config/webshopping/envoy.yaml +++ b/src/ApiGateways/Envoy/config/webshopping/envoy.yaml @@ -23,44 +23,76 @@ static_resources: domains: - "*" routes: - - match: + - name: "c-short" + match: prefix: "/c/" route: + auto_host_rewrite: true prefix_rewrite: "/catalog-api/" cluster: catalog - - match: + - name: "c-long" + match: prefix: "/catalog-api/" route: + auto_host_rewrite: true cluster: catalog - - match: + - name: "o-short" + match: prefix: "/o/" route: + auto_host_rewrite: true prefix_rewrite: "/ordering-api/" cluster: ordering - - match: + - name: "o-long" + match: prefix: "/ordering-api/" route: + auto_host_rewrite: true cluster: ordering - - match: + - name: "b-short" + match: prefix: "/b/" route: + auto_host_rewrite: true prefix_rewrite: "/basket-api/" cluster: basket - - match: + - name: "b-long" + match: prefix: "/basket-api/" route: + auto_host_rewrite: true cluster: basket - - match: + - name: "agg" + match: prefix: "/" route: + auto_host_rewrite: true prefix_rewrite: "/" cluster: shoppingagg http_filters: - - name: envoy.router + - name: envoy.router + access_log: + - name: envoy.file_access_log + filter: + not_health_check_filter: {} + config: + json_format: + time: "%START_TIME%" + protocol: "%PROTOCOL%" + duration: "%DURATION%" + request_method: "%REQ(:METHOD)%" + request_host: "%REQ(HOST)%" + path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" + response_flags: "%RESPONSE_FLAGS%" + route_name: "%ROUTE_NAME%" + upstream_host: "%UPSTREAM_HOST%" + upstream_cluster: "%UPSTREAM_CLUSTER%" + upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" + path: "/tmp/access.log" clusters: - name: shoppingagg connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: @@ -68,7 +100,7 @@ static_resources: port_value: 80 - name: catalog connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: @@ -76,7 +108,7 @@ static_resources: port_value: 80 - name: basket connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: @@ -84,7 +116,7 @@ static_resources: port_value: 80 - name: ordering connect_timeout: 0.25s - type: logical_dns + type: strict_dns lb_policy: round_robin hosts: - socket_address: diff --git a/src/docker-compose.override.yml b/src/docker-compose.override.yml index a6fa6c483..564ff4eb9 100644 --- a/src/docker-compose.override.yml +++ b/src/docker-compose.override.yml @@ -19,15 +19,20 @@ services: - ACCEPT_EULA=Y ports: - "5433:1433" + volumes: + - eshop-sqldata:/var/opt/mssql nosqldata: ports: - "27017:27017" + volumes: + - eshop-nosqldata:/data/db basketdata: ports: - "6379:6379" - + volumes: + - eshop-basketdata:/data rabbitmq: ports: - "15672:15672" @@ -69,10 +74,12 @@ services: - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - OrchestratorType=${ORCHESTRATOR_TYPE} - UseLoadTest=${USE_LOADTEST:-False} - + - PATH_BASE=/basket-api + - GRPC_PORT=81 + - PORT=80 ports: - "5103:80" - - "5580:5001" + - "9103:81" catalog-api: environment: @@ -91,6 +98,7 @@ services: - OrchestratorType=${ORCHESTRATOR_TYPE} - GRPC_PORT=81 - PORT=80 + - PATH_BASE=/catalog-api ports: - "5101:80" - "9101:81" @@ -113,9 +121,12 @@ services: - UseLoadTest=${USE_LOADTEST:-False} - Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ=Verbose - Serilog__MinimumLevel__Override__ordering-api=Verbose + - PATH_BASE=/ordering-api + - GRPC_PORT=81 + - PORT=80 ports: - "5102:80" - - "5581:5001" + - "9102:81" ordering-backgroundtasks: environment: @@ -157,6 +168,7 @@ services: - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - OrchestratorType=${ORCHESTRATOR_TYPE} - UseLoadTest=${USE_LOADTEST:-False} + - PATH_BASE=/marketing-api ports: - "5110:80" @@ -190,6 +202,7 @@ services: - ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY} - OrchestratorType=${ORCHESTRATOR_TYPE} - UseLoadTest=${USE_LOADTEST:-False} + - PATH_BASE=/locations-api ports: - "5109:80" @@ -241,9 +254,9 @@ services: - urls__catalog=http://catalog-api - urls__orders=http://ordering-api - urls__identity=http://identity-api - - urls__grpcBasket=http://10.0.75.1:5580 - - urls__grpcCatalog=http://10.0.75.1:9101 - - urls__grpcOrdering=http://10.0.75.1:5581 + - urls__grpcBasket=http://basket-api:81 + - urls__grpcCatalog=http://catalog-api:81 + - urls__grpcOrdering=http://ordering-api:81 - CatalogUrlHC=http://catalog-api/hc - OrderingUrlHC=http://ordering-api/hc - IdentityUrlHC=http://identity-api/hc @@ -262,9 +275,9 @@ services: - urls__catalog=http://catalog-api - urls__orders=http://ordering-api - urls__identity=http://identity-api - - urls__grpcBasket=http://10.0.75.1:5580 - - urls__grpcCatalog=http://10.0.75.1:9101 - - urls__grpcOrdering=http://10.0.75.1:5581 + - urls__grpcBasket=http://basket-api:81 + - urls__grpcCatalog=http://catalog-api:81 + - urls__grpcOrdering=http://ordering-api:81 - CatalogUrlHC=http://catalog-api/hc - OrderingUrlHC=http://ordering-api/hc - IdentityUrlHC=http://identity-api/hc @@ -366,4 +379,11 @@ services: - SelfUrl=http://webhooks-client/ ports: - "5114:80" +volumes: + eshop-sqldata: + external: false + eshop-nosqldata: + external: false + eshop-basketdata: + external: false