From 341d9640086929d821775712764850348584aecb Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Mon, 2 Mar 2020 08:16:34 -0600 Subject: [PATCH] Added Envoy yaml files; updated mobilemarketingapigw to use the Envoy ConfigMap --- .../mobilemarketingapigw/azure-pipelines.yml | 3 +++ .../{envoy.yaml => envoy.yml} | 4 ++-- .../mobilemarketingapigw-deploy-template.yml | 19 +++++++++++++++- .../{envoy.yaml => envoy.yml} | 22 +++++++++---------- .../{envoy.yaml => envoy.yml} | 10 ++++----- .../{envoy.yaml => envoy.yml} | 22 +++++++++---------- 6 files changed, 50 insertions(+), 30 deletions(-) rename deploy/aro/mobilemarketingapigw/{envoy.yaml => envoy.yml} (95%) rename deploy/aro/mobileshoppingapigw/{envoy.yaml => envoy.yml} (89%) rename deploy/aro/webmarketingapigw/{envoy.yaml => envoy.yml} (91%) rename deploy/aro/webshoppingapigw/{envoy.yaml => envoy.yml} (89%) diff --git a/deploy/aro/mobilemarketingapigw/azure-pipelines.yml b/deploy/aro/mobilemarketingapigw/azure-pipelines.yml index 417f3ca2e..c31359d22 100644 --- a/deploy/aro/mobilemarketingapigw/azure-pipelines.yml +++ b/deploy/aro/mobilemarketingapigw/azure-pipelines.yml @@ -35,6 +35,9 @@ stages: - script: 'oc project $(OpenShiftProject)' failOnStderr: true displayName: 'Set OpenShift Project Context' + - script: 'oc create configmap mobilemarketingapigw --from-file=./deploy/aro/mobilemarketingapigw/envoy.yml' + failOnStderr: true + displayName: 'Add Envoy ConfigMap' - script: 'oc process -f ./deploy/aro/mobilemarketingapigw/mobilemarketingapigw-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-' failOnStderr: true displayName: 'Ensure Mobile Marketing API Gateway OpenShift DeploymentConfig and Service' \ No newline at end of file diff --git a/deploy/aro/mobilemarketingapigw/envoy.yaml b/deploy/aro/mobilemarketingapigw/envoy.yml similarity index 95% rename from deploy/aro/mobilemarketingapigw/envoy.yaml rename to deploy/aro/mobilemarketingapigw/envoy.yml index 90c61967d..b89c0802b 100644 --- a/deploy/aro/mobilemarketingapigw/envoy.yaml +++ b/deploy/aro/mobilemarketingapigw/envoy.yml @@ -28,11 +28,11 @@ static_resources: prefix: "/m/" route: auto_host_rewrite: true - prefix_rewrite: "/marketingapi/" + prefix_rewrite: "/marketing-api/" cluster: marketing - name: "m-long" match: - prefix: "/marketingapi/" + prefix: "/marketing-api/" route: auto_host_rewrite: true cluster: marketing diff --git a/deploy/aro/mobilemarketingapigw/mobilemarketingapigw-deploy-template.yml b/deploy/aro/mobilemarketingapigw/mobilemarketingapigw-deploy-template.yml index 61714d9eb..28c656aab 100644 --- a/deploy/aro/mobilemarketingapigw/mobilemarketingapigw-deploy-template.yml +++ b/deploy/aro/mobilemarketingapigw/mobilemarketingapigw-deploy-template.yml @@ -24,13 +24,23 @@ objects: app: ${APPLICATION_NAME} deploymentconfig: ${APPLICATION_NAME} spec: + volumes: + - name: config + configMap: + name: ${APPLICATION_NAME}-config-map + items: + - key: envoy.yml + path: envoy.yml containers: - env: - name: PATH_BASE - value: /mobilemarketingapigw + value: /${APPLICATION_NAME} image: docker-registry.default.svc:5000/${IMAGE_REGISTRY_PROJECT_NAME}/${APPLICATION_NAME}:latest imagePullPolicy: Always name: ${APPLICATION_NAME} + volumeMounts: + - name: envoy-volume + mountPath: /etc/envoy ports: - containerPort: 8080 protocol: TCP @@ -39,6 +49,13 @@ objects: resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File + volumes: + - name: envoy-volume + configMap: + name: mobilemarketingapigw-config-map + items: + - key: envoy.yml + path: envoy.yml dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler diff --git a/deploy/aro/mobileshoppingapigw/envoy.yaml b/deploy/aro/mobileshoppingapigw/envoy.yml similarity index 89% rename from deploy/aro/mobileshoppingapigw/envoy.yaml rename to deploy/aro/mobileshoppingapigw/envoy.yml index 1ae8c45a1..cb6a0fe2e 100644 --- a/deploy/aro/mobileshoppingapigw/envoy.yaml +++ b/deploy/aro/mobileshoppingapigw/envoy.yml @@ -9,7 +9,7 @@ static_resources: - address: socket_address: address: 0.0.0.0 - port_value: 80 + port_value: 8080 filter_chains: - filters: - name: envoy.http_connection_manager @@ -103,37 +103,37 @@ static_resources: lb_policy: round_robin hosts: - socket_address: - address: webshoppingagg - port_value: 80 + address: webshoppingagg.__OpenShiftProject__.svc:8080 + port_value: 8080 - name: catalog connect_timeout: 0.25s type: strict_dns lb_policy: round_robin hosts: - socket_address: - address: catalog-api - port_value: 80 + address: catalogapi.__OpenShiftProject__.svc:8080 + port_value: 8080 - name: basket connect_timeout: 0.25s type: strict_dns lb_policy: round_robin hosts: - socket_address: - address: basket-api - port_value: 80 + address: basketapi.__OpenShiftProject__.svc:8080 + port_value: 8080 - name: ordering connect_timeout: 0.25s type: strict_dns lb_policy: round_robin hosts: - socket_address: - address: ordering-api - port_value: 80 + address: orderingapi.__OpenShiftProject__.svc:8080 + port_value: 8080 - name: signalr-hub connect_timeout: 0.25s type: strict_dns lb_policy: round_robin hosts: - socket_address: - address: ordering-signalrhub - port_value: 80 + address: orderingsignalrhub.__OpenShiftProject__.svc:8080 + port_value: 8080 diff --git a/deploy/aro/webmarketingapigw/envoy.yaml b/deploy/aro/webmarketingapigw/envoy.yml similarity index 91% rename from deploy/aro/webmarketingapigw/envoy.yaml rename to deploy/aro/webmarketingapigw/envoy.yml index c6f3421de..af71eb032 100644 --- a/deploy/aro/webmarketingapigw/envoy.yaml +++ b/deploy/aro/webmarketingapigw/envoy.yml @@ -9,7 +9,7 @@ static_resources: - address: socket_address: address: 0.0.0.0 - port_value: 80 + port_value: 8080 filter_chains: - filters: - name: envoy.http_connection_manager @@ -63,13 +63,13 @@ static_resources: lb_policy: round_robin hosts: - socket_address: - address: marketing-api - port_value: 80 + address: marketingapi.__OpenShiftProject__.svc:8080 + port_value: 8080 - name: locations connect_timeout: 0.25s type: strict_dns lb_policy: round_robin hosts: - socket_address: - address: locations-api - port_value: 80 + address: locationsapi.__OpenShiftProject__.svc:8080 + port_value: 8080 diff --git a/deploy/aro/webshoppingapigw/envoy.yaml b/deploy/aro/webshoppingapigw/envoy.yml similarity index 89% rename from deploy/aro/webshoppingapigw/envoy.yaml rename to deploy/aro/webshoppingapigw/envoy.yml index 1ae8c45a1..cb6a0fe2e 100644 --- a/deploy/aro/webshoppingapigw/envoy.yaml +++ b/deploy/aro/webshoppingapigw/envoy.yml @@ -9,7 +9,7 @@ static_resources: - address: socket_address: address: 0.0.0.0 - port_value: 80 + port_value: 8080 filter_chains: - filters: - name: envoy.http_connection_manager @@ -103,37 +103,37 @@ static_resources: lb_policy: round_robin hosts: - socket_address: - address: webshoppingagg - port_value: 80 + address: webshoppingagg.__OpenShiftProject__.svc:8080 + port_value: 8080 - name: catalog connect_timeout: 0.25s type: strict_dns lb_policy: round_robin hosts: - socket_address: - address: catalog-api - port_value: 80 + address: catalogapi.__OpenShiftProject__.svc:8080 + port_value: 8080 - name: basket connect_timeout: 0.25s type: strict_dns lb_policy: round_robin hosts: - socket_address: - address: basket-api - port_value: 80 + address: basketapi.__OpenShiftProject__.svc:8080 + port_value: 8080 - name: ordering connect_timeout: 0.25s type: strict_dns lb_policy: round_robin hosts: - socket_address: - address: ordering-api - port_value: 80 + address: orderingapi.__OpenShiftProject__.svc:8080 + port_value: 8080 - name: signalr-hub connect_timeout: 0.25s type: strict_dns lb_policy: round_robin hosts: - socket_address: - address: ordering-signalrhub - port_value: 80 + address: orderingsignalrhub.__OpenShiftProject__.svc:8080 + port_value: 8080