Merge pull request #47 from dotnet-architecture/dev
eShopOnContainers fork
This commit is contained in:
commit
7a2f41aaf8
@ -1,6 +1,9 @@
|
|||||||
# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**BETA state** - Visual Studio 2017 and CLI environments compatible)
|
# 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.
|
Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
|
||||||
|
|
||||||
|
[](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=184)
|
||||||
|
|
||||||
|
|
||||||
## IMPORTANT NOTES!
|
## IMPORTANT NOTES!
|
||||||
**You can use either the latest version of Visual Studio or simply Docker CLI and .NET CLI for Windows, Mac and Linux**.
|
**You can use either the latest version of Visual Studio or simply Docker CLI and .NET CLI for Windows, Mac and Linux**.
|
||||||
|
|
||||||
|
@ -36,6 +36,27 @@ spec:
|
|||||||
path: configuration.json
|
path: configuration.json
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
@ -50,4 +50,15 @@ env:
|
|||||||
values:
|
values:
|
||||||
- name: ASPNETCORE_ENVIRONMENT
|
- name: ASPNETCORE_ENVIRONMENT
|
||||||
value: Development
|
value: Development
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
@ -36,6 +36,27 @@ spec:
|
|||||||
path: configuration.json
|
path: configuration.json
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
@ -50,4 +50,15 @@ env:
|
|||||||
values:
|
values:
|
||||||
- name: ASPNETCORE_ENVIRONMENT
|
- name: ASPNETCORE_ENVIRONMENT
|
||||||
value: Development
|
value: Development
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
@ -36,6 +36,27 @@ spec:
|
|||||||
path: configuration.json
|
path: configuration.json
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
@ -50,4 +50,15 @@ env:
|
|||||||
values:
|
values:
|
||||||
- name: ASPNETCORE_ENVIRONMENT
|
- name: ASPNETCORE_ENVIRONMENT
|
||||||
value: Development
|
value: Development
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
@ -6,7 +6,6 @@ kind: Deployment
|
|||||||
metadata:
|
metadata:
|
||||||
name: {{ template "apigwws.fullname" . }}
|
name: {{ template "apigwws.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
ufo: {{ $cfgname}}
|
|
||||||
app: {{ template "apigwws.name" . }}
|
app: {{ template "apigwws.name" . }}
|
||||||
chart: {{ template "apigwws.chart" . }}
|
chart: {{ template "apigwws.chart" . }}
|
||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
@ -36,6 +35,27 @@ spec:
|
|||||||
path: configuration.json
|
path: configuration.json
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
@ -50,4 +50,15 @@ env:
|
|||||||
values:
|
values:
|
||||||
- name: ASPNETCORE_ENVIRONMENT
|
- name: ASPNETCORE_ENVIRONMENT
|
||||||
value: Development
|
value: Development
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -41,3 +41,15 @@ env:
|
|||||||
values:
|
values:
|
||||||
- name: OrchestratorType
|
- name: OrchestratorType
|
||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -44,4 +44,16 @@ env:
|
|||||||
value: Development
|
value: Development
|
||||||
- name: OrchestratorType
|
- name: OrchestratorType
|
||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
|
||||||
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -61,4 +61,15 @@ env:
|
|||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
- name: IsClusterEnv
|
- name: IsClusterEnv
|
||||||
value: 'True'
|
value: 'True'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -52,4 +52,15 @@ env:
|
|||||||
value: Development
|
value: Development
|
||||||
- name: OrchestratorType
|
- name: OrchestratorType
|
||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -56,4 +56,15 @@ env:
|
|||||||
value: Development
|
value: Development
|
||||||
- name: OrchestratorType
|
- name: OrchestratorType
|
||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -64,4 +64,15 @@ env:
|
|||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
- name: IsClusterEnv
|
- name: IsClusterEnv
|
||||||
value: 'True'
|
value: 'True'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -50,4 +50,15 @@ env:
|
|||||||
value: Development
|
value: Development
|
||||||
- name: OrchestratorType
|
- name: OrchestratorType
|
||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -56,4 +56,15 @@ env:
|
|||||||
value: Development
|
value: Development
|
||||||
- name: OrchestratorType
|
- name: OrchestratorType
|
||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -42,4 +42,15 @@ env:
|
|||||||
value: Development
|
value: Development
|
||||||
- name: OrchestratorType
|
- name: OrchestratorType
|
||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
@ -28,6 +28,27 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- 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 }}"
|
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
env:
|
env:
|
||||||
|
@ -64,4 +64,16 @@ env:
|
|||||||
value: 'K8S'
|
value: 'K8S'
|
||||||
- name: IsClusterEnv
|
- name: IsClusterEnv
|
||||||
value: 'True'
|
value: 'True'
|
||||||
|
probes:
|
||||||
|
liveness:
|
||||||
|
path: /liveness
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 15
|
||||||
|
port: 80
|
||||||
|
readiness:
|
||||||
|
path: /hc
|
||||||
|
timeoutSeconds: 5
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 60
|
||||||
|
port: 80
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Polly;
|
using Polly;
|
||||||
@ -10,8 +11,17 @@ namespace Microsoft.AspNetCore.Hosting
|
|||||||
{
|
{
|
||||||
public static class IWebHostExtensions
|
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
|
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())
|
using (var scope = webHost.Services.CreateScope())
|
||||||
{
|
{
|
||||||
var services = scope.ServiceProvider;
|
var services = scope.ServiceProvider;
|
||||||
@ -24,36 +34,47 @@ namespace Microsoft.AspNetCore.Hosting
|
|||||||
{
|
{
|
||||||
logger.LogInformation($"Migrating database associated with context {typeof(TContext).Name}");
|
logger.LogInformation($"Migrating database associated with context {typeof(TContext).Name}");
|
||||||
|
|
||||||
var retry = Policy.Handle<SqlException>()
|
if (underK8s)
|
||||||
.WaitAndRetry(new TimeSpan[]
|
{
|
||||||
{
|
InvokeSeeder(seeder, context, services);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var retry = Policy.Handle<SqlException>()
|
||||||
|
.WaitAndRetry(new TimeSpan[]
|
||||||
|
{
|
||||||
TimeSpan.FromSeconds(3),
|
TimeSpan.FromSeconds(3),
|
||||||
TimeSpan.FromSeconds(5),
|
TimeSpan.FromSeconds(5),
|
||||||
TimeSpan.FromSeconds(8),
|
TimeSpan.FromSeconds(8),
|
||||||
});
|
});
|
||||||
|
|
||||||
retry.Execute(() =>
|
|
||||||
{
|
|
||||||
//if the sql server container is not created on run docker compose this
|
//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
|
//migration can't fail for network related exception. The retry options for DbContext only
|
||||||
//apply to transient exceptions.
|
//apply to transient exceptions
|
||||||
|
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service)
|
||||||
context.Database
|
retry.Execute(() => InvokeSeeder(seeder, context, services));
|
||||||
.Migrate();
|
}
|
||||||
|
|
||||||
seeder(context, services);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
logger.LogInformation($"Migrated database associated with context {typeof(TContext).Name}");
|
logger.LogInformation($"Migrated database associated with context {typeof(TContext).Name}");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
logger.LogError(ex, $"An error occurred while migrating the database used on context {typeof(TContext).Name}");
|
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;
|
return webHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void InvokeSeeder<TContext>(Action<TContext, IServiceProvider> seeder, TContext context, IServiceProvider services)
|
||||||
|
where TContext : DbContext
|
||||||
|
{
|
||||||
|
context.Database.Migrate();
|
||||||
|
seeder(context, services);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
|
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
<handlers>
|
<handlers>
|
||||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
|
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
||||||
</handlers>
|
</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>
|
</system.webServer>
|
||||||
</configuration>
|
</configuration>
|
Loading…
x
Reference in New Issue
Block a user