Added the WebStatus WatchDog to the Kubernetes cluster deployment

This commit is contained in:
Cesar De la Torre 2017-05-19 17:19:29 -07:00
parent 546f443d7f
commit c3ca81b03c
9 changed files with 61671 additions and 3 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -70,7 +70,7 @@ if(-not $deployCI) {
docker-compose -p .. -f ../docker-compose.yml build
Write-Host "Pushing images to $registry..." -ForegroundColor Yellow
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "webmvc", "webspa")
$services = ("basket.api", "catalog.api", "identity.api", "ordering.api", "webmvc", "webspa", "webstatus")
foreach ($service in $services) {
docker tag eshop/$service $registry/eshop/$service
docker push $registry/eshop/$service
@ -88,10 +88,17 @@ while ($true) {
ExecKube -cmd 'create configmap urls `
--from-literal=BasketUrl=http://$($frontendUrl)/basket-api `
--from-literal=BasketHealthCheckUrl=http://$($frontendUrl)/basket-api/hc `
--from-literal=CatalogUrl=http://$($frontendUrl)/catalog-api `
--from-literal=CatalogHealthCheckUrl=http://$($frontendUrl)/catalog-api/hc `
--from-literal=IdentityUrl=http://$($frontendUrl)/identity `
--from-literal=IdentityHealthCheckUrl=http://$($frontendUrl)/identity/hc `
--from-literal=OrderingUrl=http://$($frontendUrl)/ordering-api `
--from-literal=OrderingHealthCheckUrl=http://$($frontendUrl)/ordering-api/hc `
--from-literal=MvcClient=http://$($frontendUrl)/webmvc `
--from-literal=WebMvcHealthCheckUrl=http://$($frontendUrl)/webmvc/hc `
--from-literal=WebStatusClient=http://$($frontendUrl)/webstatus `
--from-literal=WebSpaHealthCheckUrl=http://$($frontendUrl)/hc `
--from-literal=SpaClient=http://$($frontendUrl)'
ExecKube -cmd 'label configmap urls app=eshop'
@ -109,9 +116,11 @@ if(-not $deployCI) {
identity=$registry/eshop/identity.api `
ordering=$registry/eshop/ordering.api `
webmvc=$registry/eshop/webmvc `
webstatus=$registry/eshop/webstatus `
webspa=$registry/eshop/webspa'
}
ExecKube -cmd 'rollout resume -f deployments.yaml'
Write-Host "WebSPA is exposed at http://$frontendUrl, WebMVC at http://$frontendUrl/webmvc" -ForegroundColor Yellow
Write-Host "WebSPA is exposed at http://$frontendUrl, WebMVC at http://$frontendUrl/webmvc, WebStatus at http://$frontendUrl/webstatus" -ForegroundColor Yellow

View File

@ -186,6 +186,61 @@ spec:
imagePullSecrets:
- name: registry-key
---
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: webstatus
spec:
paused: true
template:
metadata:
labels:
app: eshop
component: webstatus
spec:
containers:
- name: webstatus
image: eshop/webstatus
imagePullPolicy: Always
env:
- name: ASPNETCORE_URLS
value: http://0.0.0.0:80/webstatus
- name: BasketUrl
valueFrom:
configMapKeyRef:
name: urls
key: BasketHealthCheckUrl
- name: CatalogUrl
valueFrom:
configMapKeyRef:
name: urls
key: CatalogHealthCheckUrl
- name: IdentityUrl
valueFrom:
configMapKeyRef:
name: urls
key: IdentityHealthCheckUrl
- name: OrderingUrl
valueFrom:
configMapKeyRef:
name: urls
key: OrderingHealthCheckUrl
- name: mvc
valueFrom:
configMapKeyRef:
name: urls
key: WebMvcHealthCheckUrl
- name: spa
valueFrom:
configMapKeyRef:
name: urls
key: WebSpaHealthCheckUrl
ports:
- containerPort: 80
imagePullSecrets:
- name: registry-key
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:

View File

@ -65,6 +65,12 @@ http {
proxy_set_header Host $host;
}
location /webstatus {
proxy_pass http://webstatus;
proxy_redirect off;
proxy_set_header Host $host;
}
location / {
proxy_pass http://webspa;
proxy_redirect off;

View File

@ -70,6 +70,20 @@ spec:
---
apiVersion: v1
kind: Service
metadata:
labels:
app: eshop
component: webstatus
name: webstatus
spec:
ports:
- port: 80
selector:
app: eshop
component: webstatus
---
apiVersion: v1
kind: Service
metadata:
labels:
app: eshop

File diff suppressed because one or more lines are too long