Browse Source

Final fixes to make it work under Devspaces

pull/1004/head
eiximenis 5 years ago
parent
commit
e809029e2c
24 changed files with 228 additions and 29 deletions
  1. +2
    -1
      k8s/helm/ordering-backgroundtasks/templates/configmap.yaml
  2. +2
    -2
      k8s/helm/ordering-backgroundtasks/templates/deployment.yaml
  3. +4
    -1
      src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml
  4. +4
    -1
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml
  5. +4
    -1
      src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml
  6. +4
    -1
      src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml
  7. +4
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml
  8. +4
    -2
      src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml
  9. +4
    -2
      src/Services/Basket/Basket.API/azds.yaml
  10. +9
    -0
      src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs
  11. +4
    -2
      src/Services/Catalog/Catalog.API/azds.yaml
  12. +1
    -1
      src/Services/Identity/Identity.API/Startup.cs
  13. +4
    -2
      src/Services/Identity/Identity.API/azds.yaml
  14. +4
    -2
      src/Services/Location/Locations.API/azds.yaml
  15. +4
    -2
      src/Services/Marketing/Marketing.API/azds.yaml
  16. +4
    -2
      src/Services/Ordering/Ordering.API/azds.yaml
  17. +18
    -0
      src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile.develop
  18. +56
    -0
      src/Services/Ordering/Ordering.BackgroundTasks/azds.yaml
  19. +18
    -0
      src/Services/Ordering/Ordering.SignalrHub/Dockerfile.develop
  20. +56
    -0
      src/Services/Ordering/Ordering.SignalrHub/azds.yaml
  21. +4
    -2
      src/Services/Payment/Payment.API/azds.yaml
  22. +4
    -2
      src/Services/Webhooks/Webhooks.API/azds.yaml
  23. +4
    -2
      src/Web/WebMVC/azds.yaml
  24. +6
    -0
      src/prepare-devspaces.ps1

+ 2
- 1
k8s/helm/ordering-backgroundtasks/templates/configmap.yaml View File

@ -1,10 +1,11 @@
{{- $name := include "ordering-backgroundtasks.fullname" . -}} {{- $name := include "ordering-backgroundtasks.fullname" . -}}
{{- $sqlsrv := include "sql-name" . -}} {{- $sqlsrv := include "sql-name" . -}}
{{- $cfgname := printf "cfg-%s" $name | trunc 63 }}
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: "cfg-{{ $name }}"
name: "{{ $cfgname }}"
labels: labels:
app: {{ template "ordering-backgroundtasks.name" . }} app: {{ template "ordering-backgroundtasks.name" . }}
chart: {{ template "ordering-backgroundtasks.chart" .}} chart: {{ template "ordering-backgroundtasks.chart" .}}


+ 2
- 2
k8s/helm/ordering-backgroundtasks/templates/deployment.yaml View File

@ -1,11 +1,11 @@
{{- $name := include "ordering-backgroundtasks.fullname" . -}} {{- $name := include "ordering-backgroundtasks.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
{{- $cfgname := printf "cfg-%s" $name | trunc 63 }}
apiVersion: apps/v1beta2 apiVersion: apps/v1beta2
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ template "ordering-backgroundtasks.fullname" . }} name: {{ template "ordering-backgroundtasks.fullname" . }}
labels: labels:
ufo: {{ $cfgname}}
app: {{ template "ordering-backgroundtasks.name" . }} app: {{ template "ordering-backgroundtasks.name" . }}
chart: {{ template "ordering-backgroundtasks.chart" . }} chart: {{ template "ordering-backgroundtasks.chart" . }}
release: {{ .Release.Name }} release: {{ .Release.Name }}


+ 4
- 1
src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml View File

@ -15,7 +15,10 @@ install:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io # This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io
- $(spacePrefix)apigwmm$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 1
src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml View File

@ -14,7 +14,10 @@ install:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]apigwms.<guid>.<region>.aksapp.io # This expands to [space.s.]apigwms.<guid>.<region>.aksapp.io
- $(spacePrefix)mobileshoppingagg$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 1
src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml View File

@ -15,7 +15,10 @@ install:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io # This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io
- $(spacePrefix)apigwms$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 1
src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml View File

@ -15,7 +15,10 @@ install:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io # This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io
- $(spacePrefix)apigwwm$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml View File

@ -14,7 +14,10 @@ install:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]apigwms.<guid>.<region>.aksapp.io # This expands to [space.s.]apigwms.<guid>.<region>.aksapp.io
- $(spacePrefix)webshoppingagg$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 2
src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml View File

@ -14,8 +14,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io
- $(spacePrefix)apigwws$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 2
src/Services/Basket/Basket.API/azds.yaml View File

@ -14,8 +14,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]basketapi.<guid>.<region>.aksapp.io
- $(spacePrefix)basketapi$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 9
- 0
src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs View File

@ -60,6 +60,15 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers
.Take(pageSize) .Take(pageSize)
.ToListAsync(); .ToListAsync();
/* The "awesome" fix for testing Devspaces */
/*
foreach (var pr in itemsOnPage) {
pr.Name = "Awesome " + pr.Name;
}
*/
itemsOnPage = ChangeUriPlaceholder(itemsOnPage); itemsOnPage = ChangeUriPlaceholder(itemsOnPage);
var model = new PaginatedItemsViewModel<CatalogItem>(pageIndex, pageSize, totalItems, itemsOnPage); var model = new PaginatedItemsViewModel<CatalogItem>(pageIndex, pageSize, totalItems, itemsOnPage);


+ 4
- 2
src/Services/Catalog/Catalog.API/azds.yaml View File

@ -13,8 +13,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]catalogapi.<guid>.<region>.aksapp.io
- $(spacePrefix)catalogapi$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 1
- 1
src/Services/Identity/Identity.API/Startup.cs View File

@ -86,7 +86,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
x.IssuerUri = "null"; x.IssuerUri = "null";
x.Authentication.CookieLifetime = TimeSpan.FromHours(2); x.Authentication.CookieLifetime = TimeSpan.FromHours(2);
}) })
.AddDevspacesIfNeeded(Configuration.GetValue("UseDevspaces", false))
.AddDevspacesIfNeeded(Configuration.GetValue("EnableDevspaces", false))
.AddSigningCredential(Certificate.Get()) .AddSigningCredential(Certificate.Get())
.AddAspNetIdentity<ApplicationUser>() .AddAspNetIdentity<ApplicationUser>()
.AddConfigurationStore(options => .AddConfigurationStore(options =>


+ 4
- 2
src/Services/Identity/Identity.API/azds.yaml View File

@ -14,8 +14,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]identity.<guid>.<region>.aksapp.io
- $(spacePrefix)identity-api$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 2
src/Services/Location/Locations.API/azds.yaml View File

@ -14,8 +14,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]identity.<guid>.<region>.aksapp.io
- $(spacePrefix)locations-api$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 2
src/Services/Marketing/Marketing.API/azds.yaml View File

@ -14,8 +14,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]identity.<guid>.<region>.aksapp.io
- $(spacePrefix)marketing-api$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 2
src/Services/Ordering/Ordering.API/azds.yaml View File

@ -14,8 +14,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]orderingapi.<guid>.<region>.aksapp.io
- $(spacePrefix)orderingapi$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 18
- 0
src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile.develop View File

@ -0,0 +1,18 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"]
COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"]
COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"]
COPY ["src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj", "src/Services/Ordering/Ordering.BackgroundTasks/"]
RUN dotnet restore src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj
COPY . .
WORKDIR /src/src/Services/Ordering/Ordering.BackgroundTasks
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]

+ 56
- 0
src/Services/Ordering/Ordering.BackgroundTasks/azds.yaml View File

@ -0,0 +1,56 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..
dockerfile: Dockerfile
install:
chart: ../../../../k8s/helm/ordering-backgroundtasks
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: Dockerfile.develop
args:
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
container:
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command:
- dotnet
- run
- --no-restore
- --no-build
- --no-launch-profile
- -c
- ${BUILD_CONFIGURATION:-Debug}
iterate:
processesToKill:
- dotnet
- vsdbg
buildCommands:
- - dotnet
- build
- --no-restore
- -c
- ${BUILD_CONFIGURATION:-Debug}

+ 18
- 0
src/Services/Ordering/Ordering.SignalrHub/Dockerfile.develop View File

@ -0,0 +1,18 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"]
COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"]
COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"]
COPY ["src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj", "src/Services/Ordering/Ordering.SignalrHub/"]
RUN dotnet restore src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj
COPY . .
WORKDIR /src/src/Services/Ordering/Ordering.SignalrHub
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]

+ 56
- 0
src/Services/Ordering/Ordering.SignalrHub/azds.yaml View File

@ -0,0 +1,56 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..
dockerfile: Dockerfile
install:
chart: ../../../../k8s/helm/ordering-signalrhub
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: Dockerfile.develop
args:
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
container:
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command:
- dotnet
- run
- --no-restore
- --no-build
- --no-launch-profile
- -c
- ${BUILD_CONFIGURATION:-Debug}
iterate:
processesToKill:
- dotnet
- vsdbg
buildCommands:
- - dotnet
- build
- --no-restore
- -c
- ${BUILD_CONFIGURATION:-Debug}

+ 4
- 2
src/Services/Payment/Payment.API/azds.yaml View File

@ -14,8 +14,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]paymentapi.<guid>.<region>.aksapp.io
- $(spacePrefix)paymentapi$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 2
src/Services/Webhooks/Webhooks.API/azds.yaml View File

@ -13,8 +13,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]webhooksapi.<guid>.<region>.aksapp.io
- $(spacePrefix)webhooksapi$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 4
- 2
src/Web/WebMVC/azds.yaml View File

@ -14,8 +14,10 @@ install:
annotations: annotations:
kubernetes.io/ingress.class: traefik-azds kubernetes.io/ingress.class: traefik-azds
hosts: hosts:
# This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io
- $(spacePrefix)webmvc$(hostSuffix)
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values: values:
- values.dev.yaml? - values.dev.yaml?
- secrets.dev.yaml? - secrets.dev.yaml?


+ 6
- 0
src/prepare-devspaces.ps1 View File

@ -49,6 +49,12 @@ Write-Host "Copying app.yaml and inf.yaml to Ordering API" -ForegroundColor Yell
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.API" -Force
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.SignalrHub" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.SignalrHub" -Force
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Ordering\Ordering.BackgroundTasks" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Ordering\Ordering.BackgroundTasks" -Force
Write-Host "Copying app.yaml and inf.yaml to Payment API" -ForegroundColor Yellow Write-Host "Copying app.yaml and inf.yaml to Payment API" -ForegroundColor Yellow
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Payment\Payment.API" -Force Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Payment\Payment.API" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Payment\Payment.API" -Force Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Payment\Payment.API" -Force


Loading…
Cancel
Save