Browse Source

Identity.API devspaces setup

pull/1004/head
eiximenis 6 years ago
parent
commit
1c776776c9
6 changed files with 43 additions and 91 deletions
  1. +5
    -2
      k8s/helm/identity-api/templates/ingress.yaml
  2. +4
    -6
      src/Services/Identity/Identity.API/Dockerfile.develop
  3. +0
    -39
      src/Services/Identity/Identity.API/app.yaml
  4. +30
    -18
      src/Services/Identity/Identity.API/azds.yaml
  5. +0
    -26
      src/Services/Identity/Identity.API/inf.yaml
  6. +4
    -0
      src/prepare-devspaces.ps1

+ 5
- 2
k8s/helm/identity-api/templates/ingress.yaml View File

@ -1,5 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.identity }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
@ -23,11 +24,13 @@ spec:
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.identity }}
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 4
- 6
src/Services/Identity/Identity.API/Dockerfile.develop View File

@ -1,4 +1,4 @@
FROM microsoft/dotnet:2.2.100-sdk
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
@ -6,12 +6,10 @@ EXPOSE 80
WORKDIR /src
COPY ["src/Services/Identity/Identity.API/Identity.API.csproj", "src/Services/Identity/Identity.API/"]
COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"]
COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"]
COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"]
RUN dotnet restore src/Services/Identity/Identity.API/Identity.API.csproj
RUN dotnet restore src/Services/Identity/Identity.API/Identity.API.csproj -nowarn:msb3202,nu1503
COPY . .
WORKDIR "/src/src/Services/Identity/Identity.API"
RUN dotnet build "Identity.API.csproj"
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"]
ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]

+ 0
- 39
src/Services/Identity/Identity.API/app.yaml View File

@ -1,39 +0,0 @@
app: # app global settings
name: "my-eshop" # Override for custom app name
ingress: # ingress related settings
entries:
basket: basket-api # ingress entry for basket api
catalog: catalog-api # ingress entry for catalog api
ordering: ordering-api # ingress entry for ordering api
identity: identity # ingress entry for identity api
mvc: webmvc # ingress entry for web mvc
spa: "" # ingress entry for web spa
status: webstatus # ingress entry for web status
webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw
webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw
mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw
mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw
webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator
mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator
payment: payment-api # ingress entry for payment api
locations: locations-api # ingress entry for locations api
marketing: marketing-api # ingress entry for marketing api
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
orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub
identity: identity # 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
webshoppingapigw: webshoppingapigw # service name for web shopping Agw
webmarketingapigw: webmarketingapigw # service name for web mkg Agw
mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw
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 api

+ 30
- 18
src/Services/Identity/Identity.API/azds.yaml View File

@ -1,42 +1,54 @@
kind: helm-release
apiVersion: 1.0
apiVersion: 1.1
build:
context: ..\..\..\..
dockerfile: Dockerfile
install:
chart: ../../../../k8s/helm/identity-api
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
inf:
k8s:
dns: "$(spacePrefix)identity$(hostSuffix)"
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
# This expands to [space.s.]identity.<guid>.<region>.aksapp.io
- $(spacePrefix)identity(hostSuffix)
- $(spacePrefix)identity-api$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
dockerfile: Dockerfile.develop
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}"]
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command:
- dotnet
- run
- --no-restore
- --no-build
- --no-launch-profile
- -c
- ${BUILD_CONFIGURATION:-Debug}
iterate:
processesToKill: [dotnet, vsdbg]
processesToKill:
- dotnet
- vsdbg
buildCommands:
- [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"]
- - dotnet
- build
- --no-restore
- -c
- ${BUILD_CONFIGURATION:-Debug}

+ 0
- 26
src/Services/Identity/Identity.API/inf.yaml View File

@ -1,26 +0,0 @@
# This heml values file defines all infrastructure used by eShopOnContainers.
# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment
inf:
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-<appname>" will be used
common:
user: sa # SQL user
pwd: Pass@word # SQL pwd
pid: Developer
identity:
db: IdentityDb # Ordering API SQL db name
redis: # inf.redis defines the redis' connection strings
keystore:
svc: keystore-data # Name of k8s svc for keystore-data redis
constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API)
eventbus:
svc: rabbitmq # Name of k8s svc for rabbitmq
constr: rabbitmq # Event bus connection string
useAzure: false # true if use Azure Service Bus. False if RabbitMQ
appinsights:
key: "" # App insights to use
k8s: {}
misc: # inf.misc contains miscellaneous configuration related to infrastructure
useLoadTest: false # If running under loading test or not
useAzureStorage: false # If catalog api uses azure storage or not

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

@ -33,6 +33,10 @@ Write-Host "Copying app.yaml and inf.yaml to Catalog API" -ForegroundColor Yello
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Catalog\Catalog.API" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Catalog\Catalog.API" -Force
Write-Host "Copying app.yaml and inf.yaml to Identity API" -ForegroundColor Yellow
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Services\Identity\Identity.API" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Services\Identity\Identity.API" -Force
Write-Host "Copying app.yaml and inf.yaml to WebMVC" -ForegroundColor Yellow
Copy-Item "..\k8s\helm\app.yaml" -Destination ".\Web\WebMVC" -Force
Copy-Item "..\k8s\helm\inf.yaml" -Destination ".\Web\WebMVC" -Force


Loading…
Cancel
Save