Browse Source

Merge pull request #47 from dotnet-architecture/dev

eShopOnContainers fork
pull/1934/head
Taras Kovalenko 6 years ago
committed by GitHub
parent
commit
7a2f41aaf8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 505 additions and 31 deletions
  1. +3
    -0
      README.md
  2. +21
    -0
      k8s/helm/apigwmm/templates/deployment.yaml
  3. +12
    -1
      k8s/helm/apigwmm/values.yaml
  4. +21
    -0
      k8s/helm/apigwms/templates/deployment.yaml
  5. +12
    -1
      k8s/helm/apigwms/values.yaml
  6. +21
    -0
      k8s/helm/apigwwm/templates/deployment.yaml
  7. +12
    -1
      k8s/helm/apigwwm/values.yaml
  8. +21
    -1
      k8s/helm/apigwws/templates/deployment.yaml
  9. +12
    -1
      k8s/helm/apigwws/values.yaml
  10. +21
    -0
      k8s/helm/basket-api/templates/deployment.yaml
  11. +12
    -0
      k8s/helm/basket-api/values.yaml
  12. +21
    -0
      k8s/helm/catalog-api/templates/deployment.yaml
  13. +12
    -0
      k8s/helm/catalog-api/values.yaml
  14. +21
    -0
      k8s/helm/identity-api/templates/deployment.yaml
  15. +12
    -1
      k8s/helm/identity-api/values.yaml
  16. +21
    -0
      k8s/helm/locations-api/templates/deployment.yaml
  17. +12
    -1
      k8s/helm/locations-api/values.yaml
  18. +21
    -0
      k8s/helm/marketing-api/templates/deployment.yaml
  19. +12
    -1
      k8s/helm/marketing-api/values.yaml
  20. +21
    -0
      k8s/helm/mobileshoppingagg/templates/deployment.yaml
  21. +12
    -1
      k8s/helm/mobileshoppingagg/values.yaml
  22. +21
    -0
      k8s/helm/ordering-api/templates/deployment.yaml
  23. +12
    -1
      k8s/helm/ordering-api/values.yaml
  24. +21
    -0
      k8s/helm/ordering-backgroundtasks/templates/deployment.yaml
  25. +12
    -1
      k8s/helm/ordering-backgroundtasks/values.yaml
  26. +21
    -0
      k8s/helm/payment-api/templates/deployment.yaml
  27. +12
    -1
      k8s/helm/payment-api/values.yaml
  28. +21
    -0
      k8s/helm/webshoppingagg/templates/deployment.yaml
  29. +12
    -0
      k8s/helm/webshoppingagg/values.yaml
  30. +35
    -14
      src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHostExtensions.cs
  31. +5
    -5
      src/Services/Ordering/Ordering.API/web.config

+ 3
- 0
README.md View File

@ -1,6 +1,9 @@
# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**BETA state** - Visual Studio 2017 and CLI environments compatible)
Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
[![Build status (Linux images)](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/All%20Microservices%20Linux)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=184)
## IMPORTANT NOTES!
**You can use either the latest version of Visual Studio or simply Docker CLI and .NET CLI for Windows, Mac and Linux**.


+ 21
- 0
k8s/helm/apigwmm/templates/deployment.yaml View File

@ -36,6 +36,27 @@ spec:
path: configuration.json
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:


+ 12
- 1
k8s/helm/apigwmm/values.yaml View File

@ -50,4 +50,15 @@ env:
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

+ 21
- 0
k8s/helm/apigwms/templates/deployment.yaml View File

@ -36,6 +36,27 @@ spec:
path: configuration.json
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:


+ 12
- 1
k8s/helm/apigwms/values.yaml View File

@ -50,4 +50,15 @@ env:
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

+ 21
- 0
k8s/helm/apigwwm/templates/deployment.yaml View File

@ -36,6 +36,27 @@ spec:
path: configuration.json
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:


+ 12
- 1
k8s/helm/apigwwm/values.yaml View File

@ -50,4 +50,15 @@ env:
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

+ 21
- 1
k8s/helm/apigwws/templates/deployment.yaml View File

@ -6,7 +6,6 @@ kind: Deployment
metadata:
name: {{ template "apigwws.fullname" . }}
labels:
ufo: {{ $cfgname}}
app: {{ template "apigwws.name" . }}
chart: {{ template "apigwws.chart" . }}
release: {{ .Release.Name }}
@ -36,6 +35,27 @@ spec:
path: configuration.json
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:


+ 12
- 1
k8s/helm/apigwws/values.yaml View File

@ -50,4 +50,15 @@ env:
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

+ 21
- 0
k8s/helm/basket-api/templates/deployment.yaml View File

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 0
k8s/helm/basket-api/values.yaml View File

@ -41,3 +41,15 @@ env:
values:
- name: OrchestratorType
value: 'K8S'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/catalog-api/templates/deployment.yaml View File

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 0
k8s/helm/catalog-api/values.yaml View File

@ -44,4 +44,16 @@ env:
value: Development
- name: OrchestratorType
value: 'K8S'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/identity-api/templates/deployment.yaml View File

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 1
k8s/helm/identity-api/values.yaml View File

@ -61,4 +61,15 @@ env:
value: 'K8S'
- name: IsClusterEnv
value: 'True'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/locations-api/templates/deployment.yaml View File

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 1
k8s/helm/locations-api/values.yaml View File

@ -52,4 +52,15 @@ env:
value: Development
- name: OrchestratorType
value: 'K8S'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/marketing-api/templates/deployment.yaml View File

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 1
k8s/helm/marketing-api/values.yaml View File

@ -56,4 +56,15 @@ env:
value: Development
- name: OrchestratorType
value: 'K8S'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/mobileshoppingagg/templates/deployment.yaml View File

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 1
k8s/helm/mobileshoppingagg/values.yaml View File

@ -64,4 +64,15 @@ env:
value: 'K8S'
- name: IsClusterEnv
value: 'True'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/ordering-api/templates/deployment.yaml View File

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 1
k8s/helm/ordering-api/values.yaml View File

@ -50,4 +50,15 @@ env:
value: Development
- name: OrchestratorType
value: 'K8S'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

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

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 1
k8s/helm/ordering-backgroundtasks/values.yaml View File

@ -56,4 +56,15 @@ env:
value: Development
- name: OrchestratorType
value: 'K8S'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/payment-api/templates/deployment.yaml View File

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 1
k8s/helm/payment-api/values.yaml View File

@ -42,4 +42,15 @@ env:
value: Development
- name: OrchestratorType
value: 'K8S'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/webshoppingagg/templates/deployment.yaml View File

@ -28,6 +28,27 @@ spec:
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:


+ 12
- 0
k8s/helm/webshoppingagg/values.yaml View File

@ -64,4 +64,16 @@ env:
value: 'K8S'
- name: IsClusterEnv
value: 'True'
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 35
- 14
src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHostExtensions.cs View File

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Polly;
@ -10,8 +11,17 @@ namespace Microsoft.AspNetCore.Hosting
{
public static class IWebHostExtensions
{
public static bool IsInKubernetes(this IWebHost webHost)
{
var cfg = webHost.Services.GetService<IConfiguration>();
var orchestratorType = cfg.GetValue<string>("OrchestratorType");
return orchestratorType?.ToUpper() == "K8S";
}
public static IWebHost MigrateDbContext<TContext>(this IWebHost webHost, Action<TContext,IServiceProvider> seeder) where TContext : DbContext
{
var underK8s = webHost.IsInKubernetes();
using (var scope = webHost.Services.CreateScope())
{
var services = scope.ServiceProvider;
@ -24,36 +34,47 @@ namespace Microsoft.AspNetCore.Hosting
{
logger.LogInformation($"Migrating database associated with context {typeof(TContext).Name}");
var retry = Policy.Handle<SqlException>()
.WaitAndRetry(new TimeSpan[]
{
if (underK8s)
{
InvokeSeeder(seeder, context, services);
}
else
{
var retry = Policy.Handle<SqlException>()
.WaitAndRetry(new TimeSpan[]
{
TimeSpan.FromSeconds(3),
TimeSpan.FromSeconds(5),
TimeSpan.FromSeconds(8),
});
});
retry.Execute(() =>
{
//if the sql server container is not created on run docker compose this
//migration can't fail for network related exception. The retry options for DbContext only
//apply to transient exceptions.
context.Database
.Migrate();
seeder(context, services);
});
//apply to transient exceptions
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service)
retry.Execute(() => InvokeSeeder(seeder, context, services));
}
logger.LogInformation($"Migrated database associated with context {typeof(TContext).Name}");
}
catch (Exception ex)
{
logger.LogError(ex, $"An error occurred while migrating the database used on context {typeof(TContext).Name}");
if (underK8s)
{
throw; // Rethrow under k8s because we rely on k8s to re-run the pod
}
}
}
return webHost;
}
private static void InvokeSeeder<TContext>(Action<TContext, IServiceProvider> seeder, TContext context, IServiceProvider services)
where TContext : DbContext
{
context.Database.Migrate();
seeder(context, services);
}
}
}

+ 5
- 5
src/Services/Ordering/Ordering.API/web.config View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
<environmentVariables />
</aspNetCore>
</system.webServer>
</configuration>
</configuration>

Loading…
Cancel
Save