From 02f94eeb0e8a45137f5f8b31799ef50cf266fb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Tom=C3=A1s?= Date: Mon, 16 Apr 2018 19:28:12 +0200 Subject: [PATCH] Updated k8s scripts --- k8s/deploy.ps1 | 4 +- k8s/deployments.yaml | 66 ++++++++++++++++++- .../Basket/Basket.API/Basket.API.csproj | 2 +- .../Catalog/Catalog.API/Catalog.API.csproj | 2 +- .../Identity/Identity.API/Identity.API.csproj | 2 +- .../Locations.API/Locations.API.csproj | 2 +- .../Marketing.API/Marketing.API.csproj | 2 +- .../Infrastructure/Hubs/NotificationsHub.cs | 3 - .../Ordering/Ordering.API/Ordering.API.csproj | 2 +- .../Payment/Payment.API/Payment.API.csproj | 2 +- src/Web/WebMVC/WebMVC.csproj | 2 +- src/Web/WebSPA/WebSPA.csproj | 2 +- src/Web/WebStatus/WebStatus.csproj | 2 +- 13 files changed, 78 insertions(+), 15 deletions(-) diff --git a/k8s/deploy.ps1 b/k8s/deploy.ps1 index 27c5d3fde..eb4fc9a91 100644 --- a/k8s/deploy.ps1 +++ b/k8s/deploy.ps1 @@ -65,7 +65,7 @@ if ($buildImages) { docker-compose -p .. -f ../docker-compose.yml build Write-Host "Pushing images to $registry/$dockerOrg..." -ForegroundColor Yellow - $services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "marketing.api","payment.api","locations.api", "webmvc", "webspa", "webstatus", "ocelotapigw", "mobileshoppingagg", "webshoppingagg") + $services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "ordering.backgroundtasks", "marketing.api","payment.api","locations.api", "webmvc", "webspa", "webstatus", "ocelotapigw", "mobileshoppingagg", "webshoppingagg") foreach ($service in $services) { $imageFqdn = if ($useDockerHub) {"$dockerOrg/${service}"} else {"$registry/$dockerOrg/${service}"} @@ -161,6 +161,7 @@ ExecKube -cmd 'set image deployments/basket basket=${registryPath}${dockerOrg}/b ExecKube -cmd 'set image deployments/catalog catalog=${registryPath}${dockerOrg}/catalog.api:$imageTag' ExecKube -cmd 'set image deployments/identity identity=${registryPath}${dockerOrg}/identity.api:$imageTag' ExecKube -cmd 'set image deployments/ordering ordering=${registryPath}${dockerOrg}/ordering.api:$imageTag' +ExecKube -cmd 'set image deployments/ordering-backgroundtasks ordering-backgroundtasks=${registryPath}${dockerOrg}/ordering.backgroundtasks:$imageTag' ExecKube -cmd 'set image deployments/marketing marketing=${registryPath}${dockerOrg}/marketing.api:$imageTag' ExecKube -cmd 'set image deployments/locations locations=${registryPath}${dockerOrg}/locations.api:$imageTag' ExecKube -cmd 'set image deployments/payment payment=${registryPath}${dockerOrg}/payment.api:$imageTag' @@ -181,6 +182,7 @@ ExecKube -cmd 'rollout resume deployments/basket' ExecKube -cmd 'rollout resume deployments/catalog' ExecKube -cmd 'rollout resume deployments/identity' ExecKube -cmd 'rollout resume deployments/ordering' +ExecKube -cmd 'rollout resume deployments/ordering-backgroundtasks' ExecKube -cmd 'rollout resume deployments/marketing' ExecKube -cmd 'rollout resume deployments/locations' ExecKube -cmd 'rollout resume deployments/payment' diff --git a/k8s/deployments.yaml b/k8s/deployments.yaml index a7f2f8d37..2d1ae0f43 100644 --- a/k8s/deployments.yaml +++ b/k8s/deployments.yaml @@ -289,6 +289,65 @@ spec: --- apiVersion: extensions/v1beta1 kind: Deployment +metadata: + name: ordering-backgroundtasks +spec: + paused: true + template: + metadata: + labels: + app: eshop + component: ordering-backgroundtasks + spec: + containers: + - name: ordering-backgroundtasks + image: eshop/ordering.backgroundtasks + imagePullPolicy: Always + env: + - name: ConnectionString + valueFrom: + configMapKeyRef: + name: externalcfg + key: ordering__ConnectionString + - name: EventBusConnection + valueFrom: + configMapKeyRef: + name: externalcfg + key: all__EventBusConnection + - name: AzureServiceBusEnabled + valueFrom: + configMapKeyRef: + name: externalcfg + key: all__UseAzureServiceBus + - name: CheckUpdateTime + valueFrom: + configMapKeyRef: + name: externalcfg + key: GracePeriodManager__CheckUpdateTime + - name: GracePeriodTime + valueFrom: + configMapKeyRef: + name: externalcfg + key: GracePeriodManager__GracePeriodTime + - name: ApplicationInsights__InstrumentationKey + valueFrom: + configMapKeyRef: + name: externalcfg + key: all__InstrumentationKey + - name: UseLoadTest + valueFrom: + configMapKeyRef: + name: externalcfg + key: all__EnableLoadTest + - name: OrchestratorType + value: 'K8S' + ports: + - containerPort: 80 + imagePullSecrets: + - name: registry-key +--- +apiVersion: extensions/v1beta1 +kind: Deployment metadata: name: locations spec: @@ -521,7 +580,12 @@ spec: valueFrom: configMapKeyRef: name: internalurls - key: apigwws + key: apigwws + - name: ExternalPurchaseUrl + valueFrom: + configMapKeyRef: + name: urls + key: webshoppingapigw_e - name: CallBackUrl valueFrom: configMapKeyRef: diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index d7ffa46b8..3bc5cee4c 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index 55e7f8be5..ad36cf3b7 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -37,7 +37,7 @@ - + diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index 5a30673e6..84a87a231 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Services/Location/Locations.API/Locations.API.csproj b/src/Services/Location/Locations.API/Locations.API.csproj index 13cb71821..aef0fe9e9 100644 --- a/src/Services/Location/Locations.API/Locations.API.csproj +++ b/src/Services/Location/Locations.API/Locations.API.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Services/Marketing/Marketing.API/Marketing.API.csproj b/src/Services/Marketing/Marketing.API/Marketing.API.csproj index 3f07c3970..36da8fceb 100644 --- a/src/Services/Marketing/Marketing.API/Marketing.API.csproj +++ b/src/Services/Marketing/Marketing.API/Marketing.API.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Hubs/NotificationsHub.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Hubs/NotificationsHub.cs index fe7e4d010..3db819cac 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Hubs/NotificationsHub.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Hubs/NotificationsHub.cs @@ -1,9 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; -using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services; using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Ordering.API.Infrastructure.Hubs diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index 9ad0c74a8..895c8a7d0 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -35,7 +35,7 @@ - + diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index e7e4fc739..278dcc6cb 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index 11dff90be..0160c9132 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/Web/WebSPA/WebSPA.csproj b/src/Web/WebSPA/WebSPA.csproj index bd180e7c1..f34177d65 100644 --- a/src/Web/WebSPA/WebSPA.csproj +++ b/src/Web/WebSPA/WebSPA.csproj @@ -86,7 +86,7 @@ - + diff --git a/src/Web/WebStatus/WebStatus.csproj b/src/Web/WebStatus/WebStatus.csproj index 32a311f9d..e31928fe2 100644 --- a/src/Web/WebStatus/WebStatus.csproj +++ b/src/Web/WebStatus/WebStatus.csproj @@ -7,7 +7,7 @@ - +