From a2053deb491ca44316431eee93b1aae79959ee9f Mon Sep 17 00:00:00 2001 From: eiximenis Date: Tue, 10 Sep 2019 19:49:50 +0200 Subject: [PATCH] Final charts tunning and allowing Linkerd Mesh to be used --- .../configuration-mobile-marketing.json | 34 ---- k8s/helm/apigwmm/envoy.yaml | 49 ++++++ k8s/helm/apigwmm/templates/configmap.yaml | 21 --- k8s/helm/apigwmm/templates/deployment.yaml | 12 +- .../{ocelot-cm.yaml => envoy-cm.yaml} | 4 +- k8s/helm/apigwmm/values.yaml | 48 +---- .../configuration-mobile-shopping.json | 142 --------------- k8s/helm/apigwms/envoy.yaml | 80 +++++++++ k8s/helm/apigwms/templates/configmap.yaml | 21 --- k8s/helm/apigwms/templates/deployment.yaml | 12 +- .../{ocelot-cm.yaml => envoy-cm.yaml} | 4 +- k8s/helm/apigwms/values.yaml | 48 +---- .../apigwwm/configuration-web-marketing.json | 34 ---- k8s/helm/apigwwm/envoy.yaml | 49 ++++++ k8s/helm/apigwwm/templates/configmap.yaml | 21 --- k8s/helm/apigwwm/templates/deployment.yaml | 12 +- .../{ocelot-cm.yaml => envoy-cm.yaml} | 4 +- k8s/helm/apigwwm/values.yaml | 47 +---- .../apigwws/configuration-web-shopping.json | 166 ------------------ k8s/helm/apigwws/envoy.yaml | 80 +++++++++ k8s/helm/apigwws/templates/configmap.yaml | 21 --- k8s/helm/apigwws/templates/deployment.yaml | 10 +- .../{ocelot-cm.yaml => envoy-cm.yaml} | 4 +- k8s/helm/apigwws/values.yaml | 47 +---- k8s/helm/app.yaml | 20 +-- k8s/helm/basket-api/templates/deployment.yaml | 4 + .../catalog-api/templates/deployment.yaml | 23 +-- k8s/helm/catalog-api/templates/service.yaml | 2 +- k8s/helm/deploy-all.ps1 | 31 +++- .../identity-api/templates/deployment.yaml | 4 + k8s/helm/inf.yaml | 2 + .../locations-api/templates/deployment.yaml | 4 + .../marketing-api/templates/deployment.yaml | 4 + .../templates/deployment.yaml | 4 + .../ordering-api/templates/deployment.yaml | 4 + k8s/helm/ordering-api/templates/service.yaml | 2 +- .../payment-api/templates/deployment.yaml | 4 + .../webhooks-api/templates/deployment.yaml | 4 + .../webhooks-web/templates/deployment.yaml | 4 + k8s/helm/webmvc/templates/deployment.yaml | 4 + k8s/helm/webstatus/templates/deployment.yaml | 4 + .../configuration-mobile-marketing.json | 34 ---- k8s/ocelot/configuration-mobile-shopping.json | 142 --------------- k8s/ocelot/configuration-web-marketing.json | 34 ---- k8s/ocelot/configuration-web-shopping.json | 154 ---------------- k8s/ocelot/deployment.yaml | 155 ---------------- k8s/ocelot/service.yaml | 55 ------ .../Mobile.Bff.Shopping/aggregator/Dockerfile | 1 - .../Web.Bff.Shopping/aggregator/Dockerfile | 1 - src/Services/Basket/Basket.API/Dockerfile | 1 - src/Services/Catalog/Catalog.API/Dockerfile | 1 - src/Services/Identity/Identity.API/Dockerfile | 1 - .../Location/Locations.API/Dockerfile | 1 - .../Marketing/Marketing.API/Dockerfile | 1 - src/Services/Ordering/Ordering.API/Dockerfile | 1 - .../Ordering.BackgroundTasks/Dockerfile | 1 - .../Ordering/Ordering.SignalrHub/Dockerfile | 1 - src/Services/Payment/Payment.API/Dockerfile | 1 - src/Services/Webhooks/Webhooks.API/Dockerfile | 1 - src/Web/WebMVC/Dockerfile | 1 - src/Web/WebSPA/Dockerfile | 1 - src/Web/WebStatus/Dockerfile | 1 - src/Web/WebhookClient/Dockerfile | 1 - src/docker-compose.yml | 28 +-- 64 files changed, 399 insertions(+), 1313 deletions(-) delete mode 100644 k8s/helm/apigwmm/configuration-mobile-marketing.json create mode 100644 k8s/helm/apigwmm/envoy.yaml delete mode 100644 k8s/helm/apigwmm/templates/configmap.yaml rename k8s/helm/apigwmm/templates/{ocelot-cm.yaml => envoy-cm.yaml} (70%) delete mode 100644 k8s/helm/apigwms/configuration-mobile-shopping.json create mode 100644 k8s/helm/apigwms/envoy.yaml delete mode 100644 k8s/helm/apigwms/templates/configmap.yaml rename k8s/helm/apigwms/templates/{ocelot-cm.yaml => envoy-cm.yaml} (70%) delete mode 100644 k8s/helm/apigwwm/configuration-web-marketing.json create mode 100644 k8s/helm/apigwwm/envoy.yaml delete mode 100644 k8s/helm/apigwwm/templates/configmap.yaml rename k8s/helm/apigwwm/templates/{ocelot-cm.yaml => envoy-cm.yaml} (70%) delete mode 100644 k8s/helm/apigwws/configuration-web-shopping.json create mode 100644 k8s/helm/apigwws/envoy.yaml delete mode 100644 k8s/helm/apigwws/templates/configmap.yaml rename k8s/helm/apigwws/templates/{ocelot-cm.yaml => envoy-cm.yaml} (71%) delete mode 100644 k8s/ocelot/configuration-mobile-marketing.json delete mode 100644 k8s/ocelot/configuration-mobile-shopping.json delete mode 100644 k8s/ocelot/configuration-web-marketing.json delete mode 100644 k8s/ocelot/configuration-web-shopping.json delete mode 100644 k8s/ocelot/deployment.yaml delete mode 100644 k8s/ocelot/service.yaml diff --git a/k8s/helm/apigwmm/configuration-mobile-marketing.json b/k8s/helm/apigwmm/configuration-mobile-marketing.json deleted file mode 100644 index 666df1633..000000000 --- a/k8s/helm/apigwmm/configuration-mobile-marketing.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "ReRoutes": [ - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "marketing", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/m/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "locations", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/l/{everything}", - "UpstreamHttpMethod": [] - } - - ], - "GlobalConfiguration": { - "RequestIdKey": "OcRequestId", - "AdministrationPath": "/administration" - } -} - \ No newline at end of file diff --git a/k8s/helm/apigwmm/envoy.yaml b/k8s/helm/apigwmm/envoy.yaml new file mode 100644 index 000000000..a33d276a0 --- /dev/null +++ b/k8s/helm/apigwmm/envoy.yaml @@ -0,0 +1,49 @@ +admin: + access_log_path: "/dev/null" + address: + socket_address: + address: 0.0.0.0 + port_value: 8001 +static_resources: + listeners: + - address: + socket_address: + address: 0.0.0.0 + port_value: 80 + filter_chains: + - filters: + - name: envoy.http_connection_manager + config: + codec_type: auto + stat_prefix: ingress_http + route_config: + name: eshop_backend_route + virtual_hosts: + - name: eshop_backend + domains: + - "*" + routes: + - match: + prefix: "/api/v1/m/" + route: + prefix_rewrite: "/api/v1/" + cluster: marketing + http_filters: + - name: envoy.router + clusters: + - name: marketing + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: marketing-api + port_value: 80 + - name: locations + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: locations-api + port_value: 80 diff --git a/k8s/helm/apigwmm/templates/configmap.yaml b/k8s/helm/apigwmm/templates/configmap.yaml deleted file mode 100644 index fbffcd339..000000000 --- a/k8s/helm/apigwmm/templates/configmap.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- $name := include "apigwmm.fullname" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "cfg-{{ $name }}" - labels: - app: {{ template "apigwmm.name" . }} - chart: {{ template "apigwmm.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - internalurls__identity: http://{{ .Values.app.svc.identity }} - internalurls__basket__hc: http://{{ .Values.app.svc.basket }}/hc - internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc - internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc - internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc - internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc - internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc - diff --git a/k8s/helm/apigwmm/templates/deployment.yaml b/k8s/helm/apigwmm/templates/deployment.yaml index c9abb0b62..c22c03705 100644 --- a/k8s/helm/apigwmm/templates/deployment.yaml +++ b/k8s/helm/apigwmm/templates/deployment.yaml @@ -1,6 +1,6 @@ {{- $name := include "apigwmm.fullname" . -}} {{- $cfgname := printf "%s-%s" "cfg" $name -}} -{{- $ocelotcfgname := printf "%s-%s" "ocelot" $name -}} +{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} apiVersion: apps/v1beta2 kind: Deployment metadata: @@ -30,10 +30,10 @@ spec: volumes: - name: config configMap: - name: {{ $ocelotcfgname }} + name: {{ $envoycfgname }} items: - - key: configuration-mobile-marketing.json - path: configuration.json + - key: envoy.yaml + path: envoy.yaml containers: - name: {{ .Chart.Name }} {{ if .Values.probes -}} @@ -58,10 +58,10 @@ spec: {{- end -}} {{- end }} image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + imagePullPolicy: IfNotPresent volumeMounts: - name: config - mountPath: {{ .Values.ocelot.configPath }} + mountPath: {{ .Values.envoy.configPath }} env: - name: PATH_BASE value: {{ include "pathBase" . }} diff --git a/k8s/helm/apigwmm/templates/ocelot-cm.yaml b/k8s/helm/apigwmm/templates/envoy-cm.yaml similarity index 70% rename from k8s/helm/apigwmm/templates/ocelot-cm.yaml rename to k8s/helm/apigwmm/templates/envoy-cm.yaml index c7c20ce06..71728d084 100644 --- a/k8s/helm/apigwmm/templates/ocelot-cm.yaml +++ b/k8s/helm/apigwmm/templates/envoy-cm.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: "ocelot-{{ $name }}" + name: "envoy-{{ $name }}" labels: app: {{ template "apigwmm.name" . }} chart: {{ template "apigwmm.chart" .}} release: {{ .Release.Name }} heritage: {{ .Release.Service }} data: - {{ (.Files.Glob "configuration-mobile-marketing.json").AsConfig | indent 2 }} + {{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 }} diff --git a/k8s/helm/apigwmm/values.yaml b/k8s/helm/apigwmm/values.yaml index ea87a6c05..6d626d1d3 100644 --- a/k8s/helm/apigwmm/values.yaml +++ b/k8s/helm/apigwmm/values.yaml @@ -3,9 +3,8 @@ clusterName: eshop-aks pathBase: /mobilemarketingapigw image: - repository: eshop/ocelotapigw - tag: latest - pullPolicy: IfNotPresent + repository: envoyproxy/envoy + tag: v1.11.1 service: type: ClusterIP @@ -25,42 +24,7 @@ tolerations: [] affinity: {} -# env defines the environment variables that will be declared in the pod -env: - urls: - # configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). - configmap: - - name: IdentityUrl - key: internalurls__identity - - name: CatalogUrlHC - key: internalurls__catalog__hc - - name: BasketUrlHC - key: internalurls__basket__hc - - name: IdentityUrlHC - key: internalurls__identity__hc - - name: OrderingUrlHC - key: internalurls__ordering__hc - - name: MarketingUrlHC - key: internalurls__marketing__hc - - name: PaymentUrlHC - key: internalurls__payment__hc - - name: LocationUrlHC - key: internalurls__location__hc - # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) - values: - - name: ASPNETCORE_ENVIRONMENT - value: Development -probes: - liveness: - path: /liveness - initialDelaySeconds: 10 - periodSeconds: 15 - port: 80 - readiness: - path: /hc - timeoutSeconds: 5 - initialDelaySeconds: 90 - periodSeconds: 60 - port: 80 -ocelot: - configPath: /app/configuration +env: {} + +envoy: + configPath: /etc/envoy diff --git a/k8s/helm/apigwms/configuration-mobile-shopping.json b/k8s/helm/apigwms/configuration-mobile-shopping.json deleted file mode 100644 index cf3a48aff..000000000 --- a/k8s/helm/apigwms/configuration-mobile-shopping.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "ReRoutes": [ - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "catalog", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/c/{everything}", - "UpstreamHttpMethod": [ "GET" ] - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "basket", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/b/{everything}", - "UpstreamHttpMethod": [], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/o/{everything}", - "UpstreamHttpMethod": [], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "mobileshoppingagg", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/{everything}", - "UpstreamHttpMethod": [ "POST", "PUT", "GET" ], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/orders-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "basket", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/basket-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "catalog", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/catalog-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "marketing", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/marketing-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "payment", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/payment-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "locations.api", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/location-api/{everything}", - "UpstreamHttpMethod": [] - } - - ], - "GlobalConfiguration": { - "RequestIdKey": "OcRequestId", - "AdministrationPath": "/administration" - } - } - \ No newline at end of file diff --git a/k8s/helm/apigwms/envoy.yaml b/k8s/helm/apigwms/envoy.yaml new file mode 100644 index 000000000..de8bd6058 --- /dev/null +++ b/k8s/helm/apigwms/envoy.yaml @@ -0,0 +1,80 @@ +admin: + access_log_path: "/dev/null" + address: + socket_address: + address: 0.0.0.0 + port_value: 8001 +static_resources: + listeners: + - address: + socket_address: + address: 0.0.0.0 + port_value: 80 + filter_chains: + - filters: + - name: envoy.http_connection_manager + config: + codec_type: auto + stat_prefix: ingress_http + route_config: + name: eshop_backend_route + virtual_hosts: + - name: eshop_backend + domains: + - "*" + routes: + - match: + prefix: "/api/v1/c/" + route: + prefix_rewrite: "/api/v1/" + cluster: catalog + - match: + prefix: "/api/v1/o/" + route: + prefix_rewrite: "/api/v1/" + cluster: ordering + - match: + prefix: "/api/v1/b/" + route: + prefix_rewrite: "/api/v1/" + cluster: basket + - match: + prefix: "/" + route: + prefix_rewrite: "/" + cluster: shoppingagg + http_filters: + - name: envoy.router + clusters: + - name: shoppingagg + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: webshoppingagg + port_value: 80 + - name: catalog + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: catalog-api + port_value: 80 + - name: basket + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: basket-api + port_value: 80 + - name: ordering + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: ordering-api + port_value: 80 \ No newline at end of file diff --git a/k8s/helm/apigwms/templates/configmap.yaml b/k8s/helm/apigwms/templates/configmap.yaml deleted file mode 100644 index f3292ce72..000000000 --- a/k8s/helm/apigwms/templates/configmap.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- $name := include "apigwms.fullname" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "cfg-{{ $name }}" - labels: - app: {{ template "apigwms.name" . }} - chart: {{ template "apigwms.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - internalurls__identity: http://{{ .Values.app.svc.identity }} - internalurls__basket__hc: http://{{ .Values.app.svc.basket }}/hc - internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc - internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc - internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc - internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc - internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc - diff --git a/k8s/helm/apigwms/templates/deployment.yaml b/k8s/helm/apigwms/templates/deployment.yaml index b22922f89..253116be7 100644 --- a/k8s/helm/apigwms/templates/deployment.yaml +++ b/k8s/helm/apigwms/templates/deployment.yaml @@ -1,6 +1,6 @@ {{- $name := include "apigwms.fullname" . -}} {{- $cfgname := printf "%s-%s" "cfg" $name -}} -{{- $ocelotcfgname := printf "%s-%s" "ocelot" $name -}} +{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} apiVersion: apps/v1beta2 kind: Deployment metadata: @@ -30,10 +30,10 @@ spec: volumes: - name: config configMap: - name: {{ $ocelotcfgname }} + name: {{ $envoycfgname }} items: - - key: configuration-mobile-shopping.json - path: configuration.json + - key: envoy.yaml + path: envoy.yaml containers: - name: {{ .Chart.Name }} {{ if .Values.probes -}} @@ -58,10 +58,10 @@ spec: {{- end -}} {{- end }} image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + imagePullPolicy: IfNotPresent volumeMounts: - name: config - mountPath: {{ .Values.ocelot.configPath }} + mountPath: {{ .Values.envoy.configPath }} env: - name: PATH_BASE value: {{ include "pathBase" . }} diff --git a/k8s/helm/apigwms/templates/ocelot-cm.yaml b/k8s/helm/apigwms/templates/envoy-cm.yaml similarity index 70% rename from k8s/helm/apigwms/templates/ocelot-cm.yaml rename to k8s/helm/apigwms/templates/envoy-cm.yaml index 5f92ca409..76da5832b 100644 --- a/k8s/helm/apigwms/templates/ocelot-cm.yaml +++ b/k8s/helm/apigwms/templates/envoy-cm.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: "ocelot-{{ $name }}" + name: "envoy-{{ $name }}" labels: app: {{ template "apigwms.name" . }} chart: {{ template "apigwms.chart" .}} release: {{ .Release.Name }} heritage: {{ .Release.Service }} data: - {{ (.Files.Glob "configuration-mobile-shopping.json").AsConfig | indent 2 }} + {{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 }} diff --git a/k8s/helm/apigwms/values.yaml b/k8s/helm/apigwms/values.yaml index 650ab6449..376c469c7 100644 --- a/k8s/helm/apigwms/values.yaml +++ b/k8s/helm/apigwms/values.yaml @@ -3,9 +3,8 @@ clusterName: eshop-aks pathBase: /mobileshoppingapigw image: - repository: eshop/ocelotapigw - tag: latest - pullPolicy: IfNotPresent + repository: envoyproxy/envoy + tag: v1.11.1 service: type: ClusterIP @@ -25,42 +24,7 @@ tolerations: [] affinity: {} -# env defines the environment variables that will be declared in the pod -env: - urls: - # configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). - configmap: - - name: IdentityUrl - key: internalurls__identity - - name: CatalogUrlHC - key: internalurls__catalog__hc - - name: BasketUrlHC - key: internalurls__basket__hc - - name: IdentityUrlHC - key: internalurls__identity__hc - - name: OrderingUrlHC - key: internalurls__ordering__hc - - name: MarketingUrlHC - key: internalurls__marketing__hc - - name: PaymentUrlHC - key: internalurls__payment__hc - - name: LocationUrlHC - key: internalurls__location__hc - # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) - values: - - name: ASPNETCORE_ENVIRONMENT - value: Development -probes: - liveness: - path: /liveness - initialDelaySeconds: 10 - periodSeconds: 15 - port: 80 - readiness: - path: /hc - timeoutSeconds: 5 - initialDelaySeconds: 90 - periodSeconds: 60 - port: 80 -ocelot: - configPath: /app/configuration \ No newline at end of file +env: {} + +envoy: + configPath: /etc/envoy \ No newline at end of file diff --git a/k8s/helm/apigwwm/configuration-web-marketing.json b/k8s/helm/apigwwm/configuration-web-marketing.json deleted file mode 100644 index 666df1633..000000000 --- a/k8s/helm/apigwwm/configuration-web-marketing.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "ReRoutes": [ - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "marketing", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/m/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "locations", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/l/{everything}", - "UpstreamHttpMethod": [] - } - - ], - "GlobalConfiguration": { - "RequestIdKey": "OcRequestId", - "AdministrationPath": "/administration" - } -} - \ No newline at end of file diff --git a/k8s/helm/apigwwm/envoy.yaml b/k8s/helm/apigwwm/envoy.yaml new file mode 100644 index 000000000..a33d276a0 --- /dev/null +++ b/k8s/helm/apigwwm/envoy.yaml @@ -0,0 +1,49 @@ +admin: + access_log_path: "/dev/null" + address: + socket_address: + address: 0.0.0.0 + port_value: 8001 +static_resources: + listeners: + - address: + socket_address: + address: 0.0.0.0 + port_value: 80 + filter_chains: + - filters: + - name: envoy.http_connection_manager + config: + codec_type: auto + stat_prefix: ingress_http + route_config: + name: eshop_backend_route + virtual_hosts: + - name: eshop_backend + domains: + - "*" + routes: + - match: + prefix: "/api/v1/m/" + route: + prefix_rewrite: "/api/v1/" + cluster: marketing + http_filters: + - name: envoy.router + clusters: + - name: marketing + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: marketing-api + port_value: 80 + - name: locations + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: locations-api + port_value: 80 diff --git a/k8s/helm/apigwwm/templates/configmap.yaml b/k8s/helm/apigwwm/templates/configmap.yaml deleted file mode 100644 index 34c0e6979..000000000 --- a/k8s/helm/apigwwm/templates/configmap.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- $name := include "apigwwm.fullname" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "cfg-{{ $name }}" - labels: - app: {{ template "apigwwm.name" . }} - chart: {{ template "apigwwm.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - internalurls__identity: http://{{ .Values.app.svc.identity }} - internalurls__basket__hc: http://{{ .Values.app.svc.basket }}/hc - internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc - internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc - internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc - internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc - internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc - diff --git a/k8s/helm/apigwwm/templates/deployment.yaml b/k8s/helm/apigwwm/templates/deployment.yaml index d1f39ab6c..8e99697f5 100644 --- a/k8s/helm/apigwwm/templates/deployment.yaml +++ b/k8s/helm/apigwwm/templates/deployment.yaml @@ -1,6 +1,6 @@ {{- $name := include "apigwwm.fullname" . -}} {{- $cfgname := printf "%s-%s" "cfg" $name -}} -{{- $ocelotcfgname := printf "%s-%s" "ocelot" $name -}} +{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} apiVersion: apps/v1beta2 kind: Deployment metadata: @@ -30,10 +30,10 @@ spec: volumes: - name: config configMap: - name: {{ $ocelotcfgname }} + name: {{ $envoycfgname }} items: - - key: configuration-web-marketing.json - path: configuration.json + - key: envoy.yaml + path: envoy.yaml containers: - name: {{ .Chart.Name }} {{ if .Values.probes -}} @@ -58,10 +58,10 @@ spec: {{- end -}} {{- end }} image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + imagePullPolicy: IfNotPresent volumeMounts: - name: config - mountPath: {{ .Values.ocelot.configPath }} + mountPath: {{ .Values.envoy.configPath }} env: - name: PATH_BASE value: {{ include "pathBase" . }} diff --git a/k8s/helm/apigwwm/templates/ocelot-cm.yaml b/k8s/helm/apigwwm/templates/envoy-cm.yaml similarity index 70% rename from k8s/helm/apigwwm/templates/ocelot-cm.yaml rename to k8s/helm/apigwwm/templates/envoy-cm.yaml index 3de28b1a1..4d6307e36 100644 --- a/k8s/helm/apigwwm/templates/ocelot-cm.yaml +++ b/k8s/helm/apigwwm/templates/envoy-cm.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: "ocelot-{{ $name }}" + name: "envoy-{{ $name }}" labels: app: {{ template "apigwwm.name" . }} chart: {{ template "apigwwm.chart" .}} release: {{ .Release.Name }} heritage: {{ .Release.Service }} data: - {{ (.Files.Glob "configuration-web-marketing.json").AsConfig | indent 2 -}} + {{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 -}} diff --git a/k8s/helm/apigwwm/values.yaml b/k8s/helm/apigwwm/values.yaml index 63deb5832..0f9f69ca4 100644 --- a/k8s/helm/apigwwm/values.yaml +++ b/k8s/helm/apigwwm/values.yaml @@ -3,9 +3,8 @@ clusterName: eshop-aks pathBase: /webmarketingapigw image: - repository: eshop/ocelotapigw - tag: latest - pullPolicy: IfNotPresent + repository: envoyproxy/envoy + tag: v1.11.1 service: type: ClusterIP @@ -26,41 +25,7 @@ tolerations: [] affinity: {} # env defines the environment variables that will be declared in the pod -env: - urls: - # configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). - configmap: - - name: IdentityUrl - key: internalurls__identity - - name: CatalogUrlHC - key: internalurls__catalog__hc - - name: BasketUrlHC - key: internalurls__basket__hc - - name: IdentityUrlHC - key: internalurls__identity__hc - - name: OrderingUrlHC - key: internalurls__ordering__hc - - name: MarketingUrlHC - key: internalurls__marketing__hc - - name: PaymentUrlHC - key: internalurls__payment__hc - - name: LocationUrlHC - key: internalurls__location__hc - # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) - values: - - name: ASPNETCORE_ENVIRONMENT - value: Development -probes: - liveness: - path: /liveness - initialDelaySeconds: 10 - periodSeconds: 15 - port: 80 - readiness: - path: /hc - timeoutSeconds: 5 - initialDelaySeconds: 90 - periodSeconds: 60 - port: 80 -ocelot: - configPath: /app/configuration \ No newline at end of file +env: {} + +envoy: + configPath: /etc/envoy \ No newline at end of file diff --git a/k8s/helm/apigwws/configuration-web-shopping.json b/k8s/helm/apigwws/configuration-web-shopping.json deleted file mode 100644 index 208406793..000000000 --- a/k8s/helm/apigwws/configuration-web-shopping.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "ReRoutes": [ - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "catalog", - "Port": 5000 - } - ], - "UpstreamPathTemplate": "/api/{version}/c/{everything}", - "UpstreamHttpMethod": [ "GET" ] - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "catalog", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/grpc/{version}/c/{everything}", - "UpstreamHttpMethod": [ "GET" ] - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "basket", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/b/{everything}", - "UpstreamHttpMethod": [], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/o/{everything}", - "UpstreamHttpMethod": [], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "webshoppingagg", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/{everything}", - "UpstreamHttpMethod": [ "POST", "PUT", "GET" ], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/orders-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering-signalrhub", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/hub/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "basket", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/basket-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "catalog", - "Port": 5000 - } - ], - "UpstreamPathTemplate": "/catalog-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "marketing", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/marketing-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "payment", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/payment-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "locations.api", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/location-api/{everything}", - "UpstreamHttpMethod": [] - } - - ], - "GlobalConfiguration": { - "RequestIdKey": "OcRequestId", - "AdministrationPath": "/administration" - } - } - \ No newline at end of file diff --git a/k8s/helm/apigwws/envoy.yaml b/k8s/helm/apigwws/envoy.yaml new file mode 100644 index 000000000..de8bd6058 --- /dev/null +++ b/k8s/helm/apigwws/envoy.yaml @@ -0,0 +1,80 @@ +admin: + access_log_path: "/dev/null" + address: + socket_address: + address: 0.0.0.0 + port_value: 8001 +static_resources: + listeners: + - address: + socket_address: + address: 0.0.0.0 + port_value: 80 + filter_chains: + - filters: + - name: envoy.http_connection_manager + config: + codec_type: auto + stat_prefix: ingress_http + route_config: + name: eshop_backend_route + virtual_hosts: + - name: eshop_backend + domains: + - "*" + routes: + - match: + prefix: "/api/v1/c/" + route: + prefix_rewrite: "/api/v1/" + cluster: catalog + - match: + prefix: "/api/v1/o/" + route: + prefix_rewrite: "/api/v1/" + cluster: ordering + - match: + prefix: "/api/v1/b/" + route: + prefix_rewrite: "/api/v1/" + cluster: basket + - match: + prefix: "/" + route: + prefix_rewrite: "/" + cluster: shoppingagg + http_filters: + - name: envoy.router + clusters: + - name: shoppingagg + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: webshoppingagg + port_value: 80 + - name: catalog + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: catalog-api + port_value: 80 + - name: basket + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: basket-api + port_value: 80 + - name: ordering + connect_timeout: 0.25s + type: logical_dns + lb_policy: round_robin + hosts: + - socket_address: + address: ordering-api + port_value: 80 \ No newline at end of file diff --git a/k8s/helm/apigwws/templates/configmap.yaml b/k8s/helm/apigwws/templates/configmap.yaml deleted file mode 100644 index dd5530f61..000000000 --- a/k8s/helm/apigwws/templates/configmap.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- $name := include "apigwws.fullname" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "cfg-{{ $name }}" - labels: - app: {{ template "apigwws.name" . }} - chart: {{ template "apigwws.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - internalurls__identity: http://{{ .Values.app.svc.identity }} - internalurls__basket__hc: http://{{ .Values.app.svc.basket }}/hc - internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc - internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc - internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc - internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc - internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc - diff --git a/k8s/helm/apigwws/templates/deployment.yaml b/k8s/helm/apigwws/templates/deployment.yaml index 327eb50b7..6c98d752d 100644 --- a/k8s/helm/apigwws/templates/deployment.yaml +++ b/k8s/helm/apigwws/templates/deployment.yaml @@ -1,6 +1,6 @@ {{- $name := include "apigwws.fullname" . -}} {{- $cfgname := printf "%s-%s" "cfg" $name -}} -{{- $ocelotcfgname := printf "%s-%s" "ocelot" $name -}} +{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} apiVersion: apps/v1beta2 kind: Deployment metadata: @@ -29,10 +29,10 @@ spec: volumes: - name: config configMap: - name: {{ $ocelotcfgname }} + name: {{ $envoycfgname }} items: - - key: configuration-web-shopping.json - path: configuration.json + - key: envoy.yaml + path: envoy.yaml containers: - name: {{ .Chart.Name }} {{ if .Values.probes -}} @@ -60,7 +60,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: {{ .Values.ocelot.configPath }} + mountPath: {{ .Values.envoy.configPath }} env: - name: PATH_BASE value: {{ include "pathBase" . }} diff --git a/k8s/helm/apigwws/templates/ocelot-cm.yaml b/k8s/helm/apigwws/templates/envoy-cm.yaml similarity index 71% rename from k8s/helm/apigwws/templates/ocelot-cm.yaml rename to k8s/helm/apigwws/templates/envoy-cm.yaml index 39b27f29a..6d41bd2e2 100644 --- a/k8s/helm/apigwws/templates/ocelot-cm.yaml +++ b/k8s/helm/apigwws/templates/envoy-cm.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: "ocelot-{{ $name }}" + name: "envoy-{{ $name }}" labels: app: {{ template "apigwws.name" . }} chart: {{ template "apigwws.chart" .}} release: {{ .Release.Name }} heritage: {{ .Release.Service }} data: - {{ (.Files.Glob "configuration-web-shopping.json").AsConfig | indent 2 }} + {{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 }} diff --git a/k8s/helm/apigwws/values.yaml b/k8s/helm/apigwws/values.yaml index 2b047de99..63fd70069 100644 --- a/k8s/helm/apigwws/values.yaml +++ b/k8s/helm/apigwws/values.yaml @@ -3,9 +3,8 @@ clusterName: eshop-aks pathBase: /webshoppingapigw image: - repository: eshop/ocelotapigw - tag: latest - pullPolicy: IfNotPresent + repository: envoyproxy/envoy + tag: v1.11.1 service: type: ClusterIP @@ -26,41 +25,7 @@ tolerations: [] affinity: {} # env defines the environment variables that will be declared in the pod -env: - urls: - # configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). - configmap: - - name: IdentityUrl - key: internalurls__identity - - name: CatalogUrlHC - key: internalurls__catalog__hc - - name: BasketUrlHC - key: internalurls__basket__hc - - name: IdentityUrlHC - key: internalurls__identity__hc - - name: OrderingUrlHC - key: internalurls__ordering__hc - - name: MarketingUrlHC - key: internalurls__marketing__hc - - name: PaymentUrlHC - key: internalurls__payment__hc - - name: LocationUrlHC - key: internalurls__location__hc - # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) - values: - - name: ASPNETCORE_ENVIRONMENT - value: Development -probes: - liveness: - path: /liveness - initialDelaySeconds: 10 - periodSeconds: 15 - port: 80 - readiness: - path: /hc - timeoutSeconds: 5 - initialDelaySeconds: 90 - periodSeconds: 60 - port: 80 -ocelot: - configPath: /app/configuration \ No newline at end of file +env: {} + +envoy: + configPath: /etc/envoy \ No newline at end of file diff --git a/k8s/helm/app.yaml b/k8s/helm/app.yaml index 91e829b27..da0b9f55e 100644 --- a/k8s/helm/app.yaml +++ b/k8s/helm/app.yaml @@ -25,12 +25,12 @@ app: # app global settings webhooks: webhooks-api # ingress entry for webhooks api webhooksweb: webhooks-web # ingress entry for webhooks web demo client svc: - basket: basket # service name for basket api - catalog: catalog # service name for catalog api - ordering: ordering # service name for ordering api - orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + basket: basket-apo # service name for basket api + catalog: catalog-api # service name for catalog api + ordering: ordering-api # service name for ordering api + orderingbackgroundtasks: ordering-backgroundtasks # service name for orderingbackgroundtasks orderingsignalrhub: ordering-signalrhub # service name for orderingsignalrhub - identity: identity # service name for identity api + identity: identity-api # service name for identity api mvc: webmvc # service name for web mvc spa: webspa # service name for web spa status: webstatus # service name for web status @@ -40,8 +40,8 @@ app: # app global settings mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw webshoppingagg: webshoppingagg # service name for web shopping aggregator mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator - payment: payment # service name for payment api - locations: locations # service name for locations api - marketing: marketing # service name for marketing ap - webhooks: webhooks # service name for webhooks api - webhooksweb: webhooksweb # service name for webhooks web + payment: payment-api # service name for payment api + locations: locations-api # service name for locations api + marketing: marketing-api # service name for marketing ap + webhooks: webhooks-api # service name for webhooks api + webhooksweb: webhooks-client # service name for webhooks web diff --git a/k8s/helm/basket-api/templates/deployment.yaml b/k8s/helm/basket-api/templates/deployment.yaml index 554787ab1..dc90666f5 100644 --- a/k8s/helm/basket-api/templates/deployment.yaml +++ b/k8s/helm/basket-api/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "basket-api.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/catalog-api/templates/deployment.yaml b/k8s/helm/catalog-api/templates/deployment.yaml index f9a696a90..33a0ad5b4 100644 --- a/k8s/helm/catalog-api/templates/deployment.yaml +++ b/k8s/helm/catalog-api/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "catalog-api.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: @@ -80,16 +84,6 @@ spec: protocol: TCP resources: {{ toYaml .Values.resources | indent 12 }} - - name: envoy-proxy - image: envoyproxy/envoy - imagePullPolicy: IfNotPresent - ports: - - name: envoy - containerPort: 51051 - protocol: TCP - volumeMounts: - - name: envoy-config - mountPath: /etc/envoy {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} @@ -102,13 +96,4 @@ spec: tolerations: {{ toYaml . | indent 8 }} {{- end }} - volumes: - - name: envoy-config - configMap: - name: envoy-{{ $name }} - items: - - key: _envoy.yaml - path: envoy.yaml - - key: _catalog.proto-descriptor.pb - path: catalog.proto-descriptor.pb diff --git a/k8s/helm/catalog-api/templates/service.yaml b/k8s/helm/catalog-api/templates/service.yaml index 371520ae6..f634a7088 100644 --- a/k8s/helm/catalog-api/templates/service.yaml +++ b/k8s/helm/catalog-api/templates/service.yaml @@ -14,7 +14,7 @@ spec: targetPort: http protocol: TCP name: http - - port: {{ .Values.service.grpc }} + - port: {{ .Values.service.grpcPort }} targetPort: grpc protocol: TCP name: grpc diff --git a/k8s/helm/deploy-all.ps1 b/k8s/helm/deploy-all.ps1 index 3cf6936bc..e401a0b63 100644 --- a/k8s/helm/deploy-all.ps1 +++ b/k8s/helm/deploy-all.ps1 @@ -10,7 +10,10 @@ Param( [parameter(Mandatory=$false)][string]$aksName="", [parameter(Mandatory=$false)][string]$aksRg="", [parameter(Mandatory=$false)][string]$imageTag="latest", - [parameter(Mandatory=$false)][bool]$useLocalk8s=$false + [parameter(Mandatory=$false)][bool]$useLocalk8s=$false, + [parameter(Mandatory=$false)][bool]$useMesh=$true, + [parameter(Mandatory=$false)][string][ValidateSet('Always','IfNotPresent','Never', IgnoreCase=$false)]$imagePullPolicy="Always", + [parameter(Mandatory=$false)][string]$chartsToDeploy="*" ) $dns = $externalDns @@ -62,7 +65,8 @@ if (-not [string]::IsNullOrEmpty($registry)) { Write-Host "Begin eShopOnContainers installation using Helm" -ForegroundColor Green $infras = ("sql-data", "nosql-data", "rabbitmq", "keystore-data", "basket-data") -$charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web") +$charts = ("eshop-common", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web") +$gateways = ("apigwmm", "apigwms", "apigwwm", "apigwws") if ($deployInfrastructure) { foreach ($infra in $infras) { @@ -76,16 +80,25 @@ else { if ($deployCharts) { foreach ($chart in $charts) { - Write-Host "Installing: $chart" -ForegroundColor Green - if ($useCustomRegistry) { - helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart - } - else { - if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed - helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart + if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) { + Write-Host "Installing: $chart" -ForegroundColor Green + if ($useCustomRegistry) { + helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --name="$appName-$chart" $chart + } + else { + if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed + helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --name="$appName-$chart" $chart + } } } } + + foreach ($chart in $gateways) { + if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) { + Write-Host "Installing Api Gateway Chart: $chart" -ForegroundColor Green + helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --name="$appName-$chart" $chart + } + } } else { Write-Host "eShopOnContainers non-infrastructure charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow diff --git a/k8s/helm/identity-api/templates/deployment.yaml b/k8s/helm/identity-api/templates/deployment.yaml index 0a4ee2722..c6ad69067 100644 --- a/k8s/helm/identity-api/templates/deployment.yaml +++ b/k8s/helm/identity-api/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "identity-api.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/inf.yaml b/k8s/helm/inf.yaml index ee4d1fde6..924027cbb 100644 --- a/k8s/helm/inf.yaml +++ b/k8s/helm/inf.yaml @@ -2,6 +2,8 @@ # It is used on all charts, so ** MUST BE INCLUDED ** on every deployment inf: + mesh: + enabled: true sql: # inf.sql defines the sql server databases & logins # host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used common: diff --git a/k8s/helm/locations-api/templates/deployment.yaml b/k8s/helm/locations-api/templates/deployment.yaml index 9667eb967..9a5bb608c 100644 --- a/k8s/helm/locations-api/templates/deployment.yaml +++ b/k8s/helm/locations-api/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "locations-api.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/marketing-api/templates/deployment.yaml b/k8s/helm/marketing-api/templates/deployment.yaml index c49026c1b..60d4cd1a3 100644 --- a/k8s/helm/marketing-api/templates/deployment.yaml +++ b/k8s/helm/marketing-api/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "marketing-api.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/mobileshoppingagg/templates/deployment.yaml b/k8s/helm/mobileshoppingagg/templates/deployment.yaml index 0f23b3be6..41e1fa75c 100644 --- a/k8s/helm/mobileshoppingagg/templates/deployment.yaml +++ b/k8s/helm/mobileshoppingagg/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "mobileshoppingagg.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/ordering-api/templates/deployment.yaml b/k8s/helm/ordering-api/templates/deployment.yaml index a5545ddd8..327040701 100644 --- a/k8s/helm/ordering-api/templates/deployment.yaml +++ b/k8s/helm/ordering-api/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "ordering-api.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/ordering-api/templates/service.yaml b/k8s/helm/ordering-api/templates/service.yaml index ce2bcd447..7c2cb0945 100644 --- a/k8s/helm/ordering-api/templates/service.yaml +++ b/k8s/helm/ordering-api/templates/service.yaml @@ -14,7 +14,7 @@ spec: targetPort: http protocol: TCP name: http - - port: {{ .Values.service.grpcPort }}} + - port: {{ .Values.service.grpcPort }} targetPort: grpc protocol: TCP name: grpc diff --git a/k8s/helm/payment-api/templates/deployment.yaml b/k8s/helm/payment-api/templates/deployment.yaml index 8b01f7394..f83eb37da 100644 --- a/k8s/helm/payment-api/templates/deployment.yaml +++ b/k8s/helm/payment-api/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "payment-api.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/webhooks-api/templates/deployment.yaml b/k8s/helm/webhooks-api/templates/deployment.yaml index 9eef1d6f1..2ecb885bf 100644 --- a/k8s/helm/webhooks-api/templates/deployment.yaml +++ b/k8s/helm/webhooks-api/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "webhooks-api.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/webhooks-web/templates/deployment.yaml b/k8s/helm/webhooks-web/templates/deployment.yaml index 4c930124a..43d406524 100644 --- a/k8s/helm/webhooks-web/templates/deployment.yaml +++ b/k8s/helm/webhooks-web/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "webhooks-web.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/webmvc/templates/deployment.yaml b/k8s/helm/webmvc/templates/deployment.yaml index d972db448..2889dc757 100644 --- a/k8s/helm/webmvc/templates/deployment.yaml +++ b/k8s/helm/webmvc/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "webmvc.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/helm/webstatus/templates/deployment.yaml b/k8s/helm/webstatus/templates/deployment.yaml index 6f96f81fb..70b953577 100644 --- a/k8s/helm/webstatus/templates/deployment.yaml +++ b/k8s/helm/webstatus/templates/deployment.yaml @@ -21,6 +21,10 @@ spec: labels: app: {{ template "webstatus.name" . }} release: {{ .Release.Name }} + {{ if .Values.inf.mesh.enabled -}} + annotations: + linkerd.io/inject: enabled + {{- end }} spec: {{ if .Values.inf.registry -}} imagePullSecrets: diff --git a/k8s/ocelot/configuration-mobile-marketing.json b/k8s/ocelot/configuration-mobile-marketing.json deleted file mode 100644 index 666df1633..000000000 --- a/k8s/ocelot/configuration-mobile-marketing.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "ReRoutes": [ - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "marketing", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/m/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "locations", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/l/{everything}", - "UpstreamHttpMethod": [] - } - - ], - "GlobalConfiguration": { - "RequestIdKey": "OcRequestId", - "AdministrationPath": "/administration" - } -} - \ No newline at end of file diff --git a/k8s/ocelot/configuration-mobile-shopping.json b/k8s/ocelot/configuration-mobile-shopping.json deleted file mode 100644 index cf3a48aff..000000000 --- a/k8s/ocelot/configuration-mobile-shopping.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "ReRoutes": [ - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "catalog", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/c/{everything}", - "UpstreamHttpMethod": [ "GET" ] - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "basket", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/b/{everything}", - "UpstreamHttpMethod": [], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/o/{everything}", - "UpstreamHttpMethod": [], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "mobileshoppingagg", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/{everything}", - "UpstreamHttpMethod": [ "POST", "PUT", "GET" ], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/orders-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "basket", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/basket-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "catalog", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/catalog-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "marketing", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/marketing-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "payment", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/payment-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "locations.api", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/location-api/{everything}", - "UpstreamHttpMethod": [] - } - - ], - "GlobalConfiguration": { - "RequestIdKey": "OcRequestId", - "AdministrationPath": "/administration" - } - } - \ No newline at end of file diff --git a/k8s/ocelot/configuration-web-marketing.json b/k8s/ocelot/configuration-web-marketing.json deleted file mode 100644 index 666df1633..000000000 --- a/k8s/ocelot/configuration-web-marketing.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "ReRoutes": [ - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "marketing", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/m/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "locations", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/l/{everything}", - "UpstreamHttpMethod": [] - } - - ], - "GlobalConfiguration": { - "RequestIdKey": "OcRequestId", - "AdministrationPath": "/administration" - } -} - \ No newline at end of file diff --git a/k8s/ocelot/configuration-web-shopping.json b/k8s/ocelot/configuration-web-shopping.json deleted file mode 100644 index 021056f43..000000000 --- a/k8s/ocelot/configuration-web-shopping.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "ReRoutes": [ - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "catalog", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/c/{everything}", - "UpstreamHttpMethod": [ "GET" ] - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "basket", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/b/{everything}", - "UpstreamHttpMethod": [], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/api/{version}/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/api/{version}/o/{everything}", - "UpstreamHttpMethod": [], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "webshoppingagg", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/{everything}", - "UpstreamHttpMethod": [ "POST", "PUT", "GET" ], - "AuthenticationOptions": { - "AuthenticationProviderKey": "IdentityApiKey", - "AllowedScopes": [] - } - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/orders-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "ordering-signalrhub", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/hub/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "basket", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/basket-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "catalog", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/catalog-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "marketing", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/marketing-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "payment", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/payment-api/{everything}", - "UpstreamHttpMethod": [] - }, - { - "DownstreamPathTemplate": "/{everything}", - "DownstreamScheme": "http", - "DownstreamHostAndPorts": [ - { - "Host": "locations.api", - "Port": 80 - } - ], - "UpstreamPathTemplate": "/location-api/{everything}", - "UpstreamHttpMethod": [] - } - - ], - "GlobalConfiguration": { - "RequestIdKey": "OcRequestId", - "AdministrationPath": "/administration" - } - } - \ No newline at end of file diff --git a/k8s/ocelot/deployment.yaml b/k8s/ocelot/deployment.yaml deleted file mode 100644 index 3a114e4ce..000000000 --- a/k8s/ocelot/deployment.yaml +++ /dev/null @@ -1,155 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: apigwmm -spec: - paused: true - template: - metadata: - labels: - app: eshop - component: apigwmm - spec: - containers: - - name: apigwmm - image: eshop/ocelotapigw - imagePullPolicy: Always - env: - - name: PATH_BASE - value: /mobilemarketingapigw - - name: IdentityUrl - valueFrom: - configMapKeyRef: - name: internalurls - key: identity - ports: - - containerPort: 80 - volumeMounts: - - name: config - mountPath: /app/configuration - volumes: - - name: config - configMap: - name: ocelot - items: - - key: mm - path: configuration.json - imagePullSecrets: - - name: registry-key ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: apigwms -spec: - paused: true - template: - metadata: - labels: - app: eshop - component: apigwms - spec: - containers: - - name: apigwms - image: eshop/ocelotapigw - imagePullPolicy: Always - env: - - name: PATH_BASE - value: /mobileshoppingapigw - - name: IdentityUrl - valueFrom: - configMapKeyRef: - name: internalurls - key: identity - ports: - - containerPort: 80 - volumeMounts: - - name: config - mountPath: /app/configuration - volumes: - - name: config - configMap: - name: ocelot - items: - - key: ms - path: configuration.json - imagePullSecrets: - - name: registry-key ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: apigwwm -spec: - paused: true - template: - metadata: - labels: - app: eshop - component: apigwwm - spec: - containers: - - name: apigwwm - image: eshop/ocelotapigw - imagePullPolicy: Always - env: - - name: PATH_BASE - value: /webmarketingapigw - - name: IdentityUrl - valueFrom: - configMapKeyRef: - name: internalurls - key: identity - ports: - - containerPort: 80 - volumeMounts: - - name: config - mountPath: /app/configuration - volumes: - - name: config - configMap: - name: ocelot - items: - - key: wm - path: configuration.json - imagePullSecrets: - - name: registry-key ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: apigwws -spec: - paused: true - template: - metadata: - labels: - app: eshop - component: apigwws - spec: - containers: - - name: apigwws - image: eshop/ocelotapigw - imagePullPolicy: Always - env: - - name: PATH_BASE - value: /webshoppingapigw - - name: IdentityUrl - valueFrom: - configMapKeyRef: - name: internalurls - key: identity - ports: - - containerPort: 80 - volumeMounts: - - name: config - mountPath: /app/configuration - volumes: - - name: config - configMap: - name: ocelot - items: - - key: ws - path: configuration.json - imagePullSecrets: - - name: registry-key \ No newline at end of file diff --git a/k8s/ocelot/service.yaml b/k8s/ocelot/service.yaml deleted file mode 100644 index 858b54b21..000000000 --- a/k8s/ocelot/service.yaml +++ /dev/null @@ -1,55 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: eshop - component: ocelotapigw-mm - name: ocelotapigw-mm -spec: - ports: - - port: 80 - selector: - app: eshop - component: apigwmm ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: eshop - component: ocelotapigw-ms - name: ocelotapigw-ms -spec: - ports: - - port: 80 - selector: - app: eshop - component: apigwms ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: eshop - component: ocelotapigw-wm - name: ocelotapigw-wm -spec: - ports: - - port: 80 - selector: - app: eshop - component: apigwwm ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: eshop - component: ocelotapigw-ws - name: ocelotapigw-ws -spec: - ports: - - port: 80 - selector: - app: eshop - component: apigwws diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile index 0572df716..83a81394c 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile index 82c8e88bd..19bdb9b84 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Basket/Basket.API/Dockerfile b/src/Services/Basket/Basket.API/Dockerfile index de09bf101..793b010ab 100644 --- a/src/Services/Basket/Basket.API/Dockerfile +++ b/src/Services/Basket/Basket.API/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Catalog/Catalog.API/Dockerfile b/src/Services/Catalog/Catalog.API/Dockerfile index 1ba73b95c..57d30ef1b 100644 --- a/src/Services/Catalog/Catalog.API/Dockerfile +++ b/src/Services/Catalog/Catalog.API/Dockerfile @@ -8,7 +8,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Identity/Identity.API/Dockerfile b/src/Services/Identity/Identity.API/Dockerfile index 564980f1e..9bc9ede38 100644 --- a/src/Services/Identity/Identity.API/Dockerfile +++ b/src/Services/Identity/Identity.API/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Location/Locations.API/Dockerfile b/src/Services/Location/Locations.API/Dockerfile index 9cf68a0a2..5ffacb4d6 100644 --- a/src/Services/Location/Locations.API/Dockerfile +++ b/src/Services/Location/Locations.API/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Marketing/Marketing.API/Dockerfile b/src/Services/Marketing/Marketing.API/Dockerfile index d64e7e396..b254761b4 100644 --- a/src/Services/Marketing/Marketing.API/Dockerfile +++ b/src/Services/Marketing/Marketing.API/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Ordering/Ordering.API/Dockerfile b/src/Services/Ordering/Ordering.API/Dockerfile index 3591abd0c..a4fba1949 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile +++ b/src/Services/Ordering/Ordering.API/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile b/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile index 87a735827..dfbab9484 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Ordering/Ordering.SignalrHub/Dockerfile b/src/Services/Ordering/Ordering.SignalrHub/Dockerfile index 3174a4781..657b1060f 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Dockerfile +++ b/src/Services/Ordering/Ordering.SignalrHub/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Payment/Payment.API/Dockerfile b/src/Services/Payment/Payment.API/Dockerfile index cb4a7eb59..6f3c1b1db 100644 --- a/src/Services/Payment/Payment.API/Dockerfile +++ b/src/Services/Payment/Payment.API/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Services/Webhooks/Webhooks.API/Dockerfile b/src/Services/Webhooks/Webhooks.API/Dockerfile index 6c27341f7..ad6893664 100644 --- a/src/Services/Webhooks/Webhooks.API/Dockerfile +++ b/src/Services/Webhooks/Webhooks.API/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Web/WebMVC/Dockerfile b/src/Web/WebMVC/Dockerfile index 9dc27258f..76e3b5c77 100644 --- a/src/Web/WebMVC/Dockerfile +++ b/src/Web/WebMVC/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Web/WebSPA/Dockerfile b/src/Web/WebSPA/Dockerfile index 2086051d5..62454aacb 100644 --- a/src/Web/WebSPA/Dockerfile +++ b/src/Web/WebSPA/Dockerfile @@ -16,7 +16,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Web/WebStatus/Dockerfile b/src/Web/WebStatus/Dockerfile index 95fa8b106..1e060b821 100644 --- a/src/Web/WebStatus/Dockerfile +++ b/src/Web/WebStatus/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/Web/WebhookClient/Dockerfile b/src/Web/WebhookClient/Dockerfile index d0ed6fb4a..f6d81ba0a 100644 --- a/src/Web/WebhookClient/Dockerfile +++ b/src/Web/WebhookClient/Dockerfile @@ -8,7 +8,6 @@ WORKDIR /src COPY scripts scripts/ -COPY ApiGateways/*/*.csproj csproj-files/ COPY ApiGateways/*/*/*.csproj csproj-files/ COPY BuildingBlocks/*/*/*.csproj csproj-files/ COPY Services/*/*/*.csproj csproj-files/ diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 59520672c..97245790f 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -99,34 +99,10 @@ services: - sqldata mobileshoppingapigw: - image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest} - build: - context: . - dockerfile: ApiGateways/ApiGw-Base/Dockerfile - depends_on: - - nosqldata - - sqldata - - identity-api - - rabbitmq - - ordering-api - - marketing-api - - catalog-api - - basket-api + image: envoyproxy/envoy:v1.11.1 mobilemarketingapigw: - image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest} - build: - context: . - dockerfile: ApiGateways/ApiGw-Base/Dockerfile - depends_on: - - nosqldata - - sqldata - - identity-api - - rabbitmq - - ordering-api - - marketing-api - - catalog-api - - basket-api + image: envoyproxy/envoy:v1.11.1 mobileshoppingagg: image: ${REGISTRY:-eshop}/mobileshoppingagg:${PLATFORM:-linux}-${TAG:-latest}