Skip to content

Commit cb5e8c1

Browse files
authored
Merge pull request #9 from vany0114/health-checks
Health checks implementation & ConfigMap set up
2 parents ae91141 + 8b09d99 commit cb5e8c1

File tree

44 files changed

+615
-219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+615
-219
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ msbuild.wrn
4040
src/Web/Duber.WebSite/wwwroot/lib
4141
node_modules
4242
packages/
43+
src/Web/Duber.WebSite/healthchecksdb-shm
44+
src/Web/Duber.WebSite/healthchecksdb
45+
src/Web/Duber.WebSite/healthchecksdb-wal

ChangeLog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 2.0.4
2+
**Health checks implementation & ConfigMap set up:**
3+
* Add health checks to all microservices
4+
* Add health checks UI add-on to frontend
5+
* Upgrade EF Core to `3.0.0`
6+
* Organize better the `Startup` files
7+
* Set up k8s probes
8+
* Move env variables to a common `ConfigMap`
9+
110
## 2.0.3
211
**Event bus handlers idempotency:**
312
* Add *Duber.Infrastructure.EventBus.Idempotency* project to handle idempotency at integration events level.

build-images.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
param([String]$service="all")
2+
3+
if ($service -eq "all")
4+
{
5+
docker-compose -f docker-compose.yml build
6+
}
7+
else
8+
{
9+
docker-compose -f docker-compose.yml build $service
10+
}

deploy/k8s/local/delete-resources.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# configmap
2+
kubectl delete cm env-config
3+
14
# external system
25
kubectl delete deploy payment
36
kubectl delete svc payment

deploy/k8s/local/deploy-local.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ kubectl apply -f dashboard-adminuser.yaml
66
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
77
kubectl apply -f nginx-ingress\custom-service.yaml
88

9+
# configmap
10+
kubectl apply -f env-config.yaml
11+
912
# mongo
1013
kubectl apply -f mongo\mongo-admin.yaml
1114
kubectl apply -f mongo\mongo-deployment.yaml

deploy/k8s/local/env-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: env-config
5+
data:
6+
ASPNETCORE_ENVIRONMENT: Development
7+
ConnectionStrings__InvoiceDB: Server=sql-data;Database=Duber.InvoiceDb;User Id=sa;Password=Pass@word
8+
ConnectionStrings__WebsiteDB: Server=sql-data;Database=Duber.WebSiteDb;User Id=sa;Password=Pass@word
9+
ConnectionStrings__SignalrBackPlane: redis
10+
EventStoreConfiguration__ConnectionString: mongodb://nosql-data
11+
EventBusConnection: rabbitmq
12+
PaymentServiceBaseUrl: http://payment
13+
InvoiceApiSettings__BaseUrl: http://invoice
14+
TripApiSettings__BaseUrl: http://trip
15+
TripApiSettings__NotificationsClientUrl: http://trip.notifications.local.com:81
16+
TripApiSettings__NotificationsServerUrl: http://notifications
17+
AzureServiceBusEnabled: "false"
18+
IsDeployedOnCluster: "true"

deploy/k8s/local/external-system/payment-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ spec:
1616
- name: payment
1717
image: vany0114/externalsystem.paymentservice
1818
imagePullPolicy: Always
19-
env:
20-
- name: ASPNETCORE_ENVIRONMENT
21-
value: "Development"
19+
envFrom:
20+
- configMapRef:
21+
name: env-config
2222
ports:
2323
- containerPort: 80

deploy/k8s/local/invoice/invoice-deployment.yaml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,21 @@ spec:
2323
limits:
2424
memory: "256Mi"
2525
cpu: "500m"
26-
env:
27-
- name: ASPNETCORE_ENVIRONMENT
28-
value: "Development"
29-
- name: ConnectionStrings__InvoiceDB
30-
value: "Server=sql-data;Database=Duber.InvoiceDb;User Id=sa;Password=Pass@word"
31-
- name: EventBusConnection
32-
value: "rabbitmq"
33-
- name: PaymentServiceBaseUrl
34-
value: "http://payment"
35-
- name: AzureServiceBusEnabled
36-
value: "False"
26+
envFrom:
27+
- configMapRef:
28+
name: env-config
29+
livenessProbe:
30+
httpGet:
31+
port: 80
32+
path: /liveness
33+
initialDelaySeconds: 10
34+
periodSeconds: 10
35+
readinessProbe:
36+
httpGet:
37+
path: /readiness
38+
port: 80
39+
initialDelaySeconds: 30
40+
periodSeconds: 60
41+
timeoutSeconds: 5
3742
ports:
3843
- containerPort: 80

deploy/k8s/local/notifications/notifications-deployment.yaml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,21 @@ spec:
2323
limits:
2424
memory: "256Mi"
2525
cpu: "600m"
26-
env:
27-
- name: ASPNETCORE_ENVIRONMENT
28-
value: "Development"
29-
- name: ConnectionStrings__SignalrBackPlane
30-
value: "redis"
31-
- name: EventBusConnection
32-
value: "rabbitmq"
33-
- name: AzureServiceBusEnabled
34-
value: "False"
35-
- name: IsDeployedOnCluster
36-
value: "True"
26+
envFrom:
27+
- configMapRef:
28+
name: env-config
29+
livenessProbe:
30+
httpGet:
31+
port: 80
32+
path: /liveness
33+
initialDelaySeconds: 10
34+
periodSeconds: 10
35+
readinessProbe:
36+
httpGet:
37+
path: /readiness
38+
port: 80
39+
initialDelaySeconds: 30
40+
periodSeconds: 60
41+
timeoutSeconds: 5
3742
ports:
3843
- containerPort: 80

deploy/k8s/local/trip/trip-deployment.yaml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,21 @@ spec:
2323
limits:
2424
memory: "256Mi"
2525
cpu: "600m"
26-
env:
27-
- name: ASPNETCORE_ENVIRONMENT
28-
value: "Development"
29-
- name: EventStoreConfiguration__ConnectionString
30-
value: "mongodb://nosql-data"
31-
- name: EventBusConnection
32-
value: "rabbitmq"
33-
- name: AzureServiceBusEnabled
34-
value: "False"
26+
envFrom:
27+
- configMapRef:
28+
name: env-config
29+
livenessProbe:
30+
httpGet:
31+
port: 80
32+
path: /liveness
33+
initialDelaySeconds: 10
34+
periodSeconds: 10
35+
readinessProbe:
36+
httpGet:
37+
path: /readiness
38+
port: 80
39+
initialDelaySeconds: 30
40+
periodSeconds: 60
41+
timeoutSeconds: 5
3542
ports:
3643
- containerPort: 80

0 commit comments

Comments
 (0)