Skip to content

Commit c3ca81b

Browse files
Added the WebStatus WatchDog to the Kubernetes cluster deployment
1 parent 546f443 commit c3ca81b

9 files changed

Lines changed: 61671 additions & 3 deletions

File tree

k8s/.kube/schema/v1.5.3/api/v1/schema.json

Lines changed: 20024 additions & 0 deletions
Large diffs are not rendered by default.

k8s/.kube/schema/v1.5.3/apis/extensions/v1beta1/schema.json

Lines changed: 10768 additions & 0 deletions
Large diffs are not rendered by default.

k8s/.kube/schema/v1.5.3/schema095733259

Lines changed: 20024 additions & 0 deletions
Large diffs are not rendered by default.

k8s/.kube/schema/v1.5.3/schema392735526

Lines changed: 10768 additions & 0 deletions
Large diffs are not rendered by default.

k8s/deploy.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if(-not $deployCI) {
7070
docker-compose -p .. -f ../docker-compose.yml build
7171

7272
Write-Host "Pushing images to $registry..." -ForegroundColor Yellow
73-
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "webmvc", "webspa")
73+
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "webmvc", "webspa", "webstatus")
7474
foreach ($service in $services) {
7575
docker tag eshop/$service $registry/eshop/$service
7676
docker push $registry/eshop/$service
@@ -88,10 +88,17 @@ while ($true) {
8888

8989
ExecKube -cmd 'create configmap urls `
9090
--from-literal=BasketUrl=http://$($frontendUrl)/basket-api `
91+
--from-literal=BasketHealthCheckUrl=http://$($frontendUrl)/basket-api/hc `
9192
--from-literal=CatalogUrl=http://$($frontendUrl)/catalog-api `
93+
--from-literal=CatalogHealthCheckUrl=http://$($frontendUrl)/catalog-api/hc `
9294
--from-literal=IdentityUrl=http://$($frontendUrl)/identity `
95+
--from-literal=IdentityHealthCheckUrl=http://$($frontendUrl)/identity/hc `
9396
--from-literal=OrderingUrl=http://$($frontendUrl)/ordering-api `
97+
--from-literal=OrderingHealthCheckUrl=http://$($frontendUrl)/ordering-api/hc `
9498
--from-literal=MvcClient=http://$($frontendUrl)/webmvc `
99+
--from-literal=WebMvcHealthCheckUrl=http://$($frontendUrl)/webmvc/hc `
100+
--from-literal=WebStatusClient=http://$($frontendUrl)/webstatus `
101+
--from-literal=WebSpaHealthCheckUrl=http://$($frontendUrl)/hc `
95102
--from-literal=SpaClient=http://$($frontendUrl)'
96103

97104
ExecKube -cmd 'label configmap urls app=eshop'
@@ -109,9 +116,11 @@ if(-not $deployCI) {
109116
identity=$registry/eshop/identity.api `
110117
ordering=$registry/eshop/ordering.api `
111118
webmvc=$registry/eshop/webmvc `
119+
webstatus=$registry/eshop/webstatus `
112120
webspa=$registry/eshop/webspa'
113121
}
114122

115123
ExecKube -cmd 'rollout resume -f deployments.yaml'
116124

117-
Write-Host "WebSPA is exposed at http://$frontendUrl, WebMVC at http://$frontendUrl/webmvc" -ForegroundColor Yellow
125+
Write-Host "WebSPA is exposed at http://$frontendUrl, WebMVC at http://$frontendUrl/webmvc, WebStatus at http://$frontendUrl/webstatus" -ForegroundColor Yellow
126+

k8s/deployments.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,61 @@ spec:
186186
imagePullSecrets:
187187
- name: registry-key
188188
---
189+
---
190+
apiVersion: extensions/v1beta1
191+
kind: Deployment
192+
metadata:
193+
name: webstatus
194+
spec:
195+
paused: true
196+
template:
197+
metadata:
198+
labels:
199+
app: eshop
200+
component: webstatus
201+
spec:
202+
containers:
203+
- name: webstatus
204+
image: eshop/webstatus
205+
imagePullPolicy: Always
206+
env:
207+
- name: ASPNETCORE_URLS
208+
value: http://0.0.0.0:80/webstatus
209+
- name: BasketUrl
210+
valueFrom:
211+
configMapKeyRef:
212+
name: urls
213+
key: BasketHealthCheckUrl
214+
- name: CatalogUrl
215+
valueFrom:
216+
configMapKeyRef:
217+
name: urls
218+
key: CatalogHealthCheckUrl
219+
- name: IdentityUrl
220+
valueFrom:
221+
configMapKeyRef:
222+
name: urls
223+
key: IdentityHealthCheckUrl
224+
- name: OrderingUrl
225+
valueFrom:
226+
configMapKeyRef:
227+
name: urls
228+
key: OrderingHealthCheckUrl
229+
- name: mvc
230+
valueFrom:
231+
configMapKeyRef:
232+
name: urls
233+
key: WebMvcHealthCheckUrl
234+
- name: spa
235+
valueFrom:
236+
configMapKeyRef:
237+
name: urls
238+
key: WebSpaHealthCheckUrl
239+
ports:
240+
- containerPort: 80
241+
imagePullSecrets:
242+
- name: registry-key
243+
---
189244
apiVersion: extensions/v1beta1
190245
kind: Deployment
191246
metadata:

k8s/nginx.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ http {
6565
proxy_set_header Host $host;
6666
}
6767

68+
location /webstatus {
69+
proxy_pass http://webstatus;
70+
proxy_redirect off;
71+
proxy_set_header Host $host;
72+
}
73+
6874
location / {
6975
proxy_pass http://webspa;
7076
proxy_redirect off;

k8s/services.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ spec:
7070
---
7171
apiVersion: v1
7272
kind: Service
73+
metadata:
74+
labels:
75+
app: eshop
76+
component: webstatus
77+
name: webstatus
78+
spec:
79+
ports:
80+
- port: 80
81+
selector:
82+
app: eshop
83+
component: webstatus
84+
---
85+
apiVersion: v1
86+
kind: Service
7387
metadata:
7488
labels:
7589
app: eshop

src/Web/WebMVC/wwwroot/css/site.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)