Skip to content

Commit 0135104

Browse files
authored
Updates (#815)
1 parent a093c19 commit 0135104

File tree

7 files changed

+84
-53
lines changed

7 files changed

+84
-53
lines changed

cloudbank-v32/README.md

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,25 @@ Version 3.2 of CloudBank is under development. This document and application is
8282
8383
## Deploy CloudBank
8484
85-
CloudBank can be deployed using the `--script` command in `oractl`. CloudBank will be deployed in the namespace `cb32`. You are going to be asked for passwords when the `bind` command executes.
85+
CloudBank can be deployed using the `--script` command in `oractl`. CloudBank will be deployed in the namespace `application`. You are going to be asked for passwords when the `bind` command executes.
8686
8787
```text
88-
oractl:>script --file deploy-cmds/deploy-cb32.txt
88+
oractl:>script --file deploy-cmds/deploy-cb.txt
8989
```
9090
9191
The output should look similar to this:
9292
9393
```text
94-
application/namespace created successfully and image pull secret (registry-auth) created successfully and database TNSAdmin/wallet secret created successfully
9594
Database/Service Password: *************
96-
Schema {account} was successfully Created and Kubernetes Secret {cb32/account} was successfully Created.
95+
Schema {account} was successfully Created and Kubernetes Secret {application/account} was successfully Created.
9796
Database/Service Password: *************
98-
Schema {account} was successfully Not_Modified and Kubernetes Secret {cb32/checks} was successfully Created.
97+
Schema {account} was successfully Not_Modified and Kubernetes Secret {application/checks} was successfully Created.
9998
Database/Service Password: *************
100-
Schema {customer} was successfully Created and Kubernetes Secret {cb32/customer} was successfully Created.
99+
Schema {customer} was successfully Created and Kubernetes Secret {application/customer} was successfully Created.
101100
Database/Service Password: *************
102-
Schema {customer} was successfully Not_Modified and Kubernetes Secret {cb32/customer32} was successfully Created.
101+
Schema {customer} was successfully Not_Modified and Kubernetes Secret {application/customer32} was successfully Created.
103102
Database/Service Password: *************
104-
Schema {account} was successfully Not_Modified and Kubernetes Secret {cb32/testrunner} was successfully Created.
103+
Schema {account} was successfully Not_Modified and Kubernetes Secret {application/testrunner} was successfully Created.
105104
uploading: account/target/account-0.0.1-SNAPSHOT.jar
106105
building and pushing image...
107106
@@ -149,19 +148,38 @@ NOTICE: service not accessible outside K8S
149148
The following commands are executed:
150149
151150
```script
152-
create --app-name cb32
153-
bind --app-name cb32 --service-name account
154-
bind --app-name cb32 --service-name checks --username account
155-
bind --app-name cb32 --service-name customer
156-
bind --app-name cb32 --service-name customer32 --username customer
157-
bind --app-name cb32 --service-name testrunner --username account
158-
deploy --app-name cb32 --service-name account --artifact-path account/target/account-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
159-
deploy --app-name cb32 --service-name checks --artifact-path checks/target/checks-0.0.1-SNAPSHOT.jar --image-version 0.0.1
160-
deploy --app-name cb32 --service-name customer --artifact-path customer/target/customer-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
161-
deploy --app-name cb32 --service-name customer32 --artifact-path customer32/target/customer32-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
162-
deploy --app-name cb32 --service-name creditscore --artifact-path creditscore/target/creditscore-0.0.1-SNAPSHOT.jar --image-version 0.0.1
163-
deploy --app-name cb32 --service-name testrunner --artifact-path testrunner/target/testrunner-0.0.1-SNAPSHOT.jar --image-version 0.0.1
164-
deploy --app-name cb32 --service-name transfer --artifact-path transfer/target/transfer-0.0.1-SNAPSHOT.jar --image-version 0.0.1
151+
bind --service-name account
152+
bind --service-name checks --username account
153+
bind --service-name customer
154+
bind --service-name customer32 --username customer
155+
bind --service-name testrunner --username account
156+
deploy --service-name account --artifact-path account/target/account-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
157+
deploy --service-name checks --artifact-path checks/target/checks-0.0.1-SNAPSHOT.jar --image-version 0.0.1
158+
deploy --service-name customer --artifact-path customer/target/customer-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
159+
deploy --service-name customer32 --artifact-path customer32/target/customer32-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
160+
deploy --service-name creditscore --artifact-path creditscore/target/creditscore-0.0.1-SNAPSHOT.jar --image-version 0.0.1
161+
deploy --service-name testrunner --artifact-path testrunner/target/testrunner-0.0.1-SNAPSHOT.jar --image-version 0.0.1
162+
deploy --service-name transfer --artifact-path transfer/target/transfer-0.0.1-SNAPSHOT.jar --image-version 0.0.1
163+
```
164+
165+
## Optional - autoscaling
166+
167+
Create autoscalers for CloudBank.
168+
169+
```text
170+
oractl:>script --file deploy-cmds/autoscale-cmd.txt
171+
```
172+
173+
The following commands are executed:
174+
175+
```script
176+
create-autoscaler --service-name account --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
177+
create-autoscaler --service-name checks --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
178+
create-autoscaler --service-name customer --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
179+
create-autoscaler --service-name customer32 --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
180+
create-autoscaler --service-name creditscore --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
181+
create-autoscaler --service-name testrunner --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
182+
create-autoscaler --service-name transfer --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
165183
```
166184
167185
## OpenAPI
@@ -179,7 +197,7 @@ This is an example of the `customer32` application:
179197
1. Port forward
180198
181199
```shell
182-
kubectl port-forward -n cb32 svc/account 8081:8080
200+
kubectl port-forward -n application svc/account 8081:8080
183201
```
184202
185203
1. Rest endpoint
@@ -210,7 +228,7 @@ This is an example of the `customer32` application:
210228
1. Port forward
211229
212230
```shell
213-
kubectl port-forward -n cb32 svc/customer 8082:8080
231+
kubectl port-forward -n application svc/customer 8082:8080
214232
```
215233
216234
1. REST endpoint
@@ -240,13 +258,13 @@ This is an example of the `customer32` application:
240258
1. Port forward
241259
242260
```shell
243-
kubectl port-forward -n cb32 svc/customer32 9000:8080
261+
kubectl port-forward -n application svc/customer32 9000:8080
244262
```
245263
246264
1. REST endpoint
247265
248266
```shell
249-
curl -s http://localhost:8082/api/v1/customer | jq
267+
curl -s http://localhost:9000/api/v2/customer | jq
250268
```
251269
252270
Should return:
@@ -267,7 +285,7 @@ This is an example of the `customer32` application:
267285
1. Port forward
268286
269287
```shell
270-
kubectl port-forward -n cb32 svc/creditscore 8083:8080
288+
kubectl port-forward -n application svc/creditscore 8083:8080
271289
``````
272290
273291
1. REST endpoint
@@ -290,13 +308,13 @@ This is an example of the `customer32` application:
290308
1. Port forward
291309
292310
```shell
293-
kubectl -n cb32 port-forward svc/testrunner 8084:8080
311+
kubectl -n application port-forward svc/testrunner 8084:8080
294312
```
295313
296314
1. REST endpoint - deposit check. Make sure you use an existing account number
297315
298316
```shell
299-
curl -i -X POST -H 'Content-Type: application/json' -d '{"accountId": 2, "amount": 256}' http://localhost:8084/api/v1/testrunner/deposit
317+
curl -i -X POST -H 'Content-Type: application/json' -d '{"accountId": 21, "amount": 256}' http://localhost:8084/api/v1/testrunner/deposit
300318
```
301319
302320
Should return:
@@ -313,7 +331,7 @@ This is an example of the `customer32` application:
313331
1. Check application log
314332
315333
```shell
316-
kubectl -n cb32 logs svc/checks
334+
kubectl logs -n application svc/checks
317335
```
318336
319337
Should contain:
@@ -322,7 +340,7 @@ This is an example of the `customer32` application:
322340
Received deposit <CheckDeposit(accountId=21, amount=256)>
323341
```
324342
325-
1. Check journal entries
343+
1. Check journal entries. Replace '21' with the account number you used.
326344
327345
```shell
328346
curl -i http://localhost:8081/api/v1/account/21/journal
@@ -359,7 +377,7 @@ This is an example of the `customer32` application:
359377
1. Check application log
360378
361379
```shell
362-
kubectl -n cb32 logs svc/checks
380+
kubectl logs -n application svc/checks
363381
```
364382
365383
Output should be similar to:
@@ -392,7 +410,7 @@ This is an example of the `customer32` application:
392410
1. Port forward
393411
394412
```shell
395-
kubectl -n cb32 port-forward svc/transfer 8085:8080
413+
kubectl -n application port-forward svc/transfer 8085:8080
396414
```
397415
398416
1. Check account balances. Note that the account numbers 21 and 22 can be different in your environment
@@ -468,7 +486,7 @@ This is an example of the `customer32` application:
468486
1. Check the application log to confirm
469487
470488
```shell
471-
kubectl -n cb32 logs svc/transfer
489+
kubectl logs -n application svc/transfer
472490
```
473491
474492
Output should look similar to this:

cloudbank-v32/deploy-cmds/apponly-cb32.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
create-autoscaler --service-name account --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
2+
create-autoscaler --service-name checks --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
3+
create-autoscaler --service-name customer --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
4+
create-autoscaler --service-name customer32 --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
5+
create-autoscaler --service-name creditscore --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
6+
create-autoscaler --service-name testrunner --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
7+
create-autoscaler --service-name transfer --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
delete-autoscaler --service-name account
2+
delete-autoscaler --service-name checks
3+
delete-autoscaler --service-name customer
4+
delete-autoscaler --service-name customer32
5+
delete-autoscaler --service-name creditscore
6+
delete-autoscaler --service-name testrunner
7+
delete-autoscaler --service-name transfer
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
deploy --service-name account --artifact-path account/target/account-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
2+
deploy --service-name checks --artifact-path checks/target/checks-0.0.1-SNAPSHOT.jar --image-version 0.0.1
3+
deploy --service-name customer --artifact-path customer/target/customer-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
4+
deploy --service-name customer32 --artifact-path customer32/target/customer32-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
5+
deploy --service-name creditscore --artifact-path creditscore/target/creditscore-0.0.1-SNAPSHOT.jar --image-version 0.0.1
6+
deploy --service-name testrunner --artifact-path testrunner/target/testrunner-0.0.1-SNAPSHOT.jar --image-version 0.0.1
7+
deploy --service-name transfer --artifact-path transfer/target/transfer-0.0.1-SNAPSHOT.jar --image-version 0.0.1
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
bind --service-name account
2+
bind --service-name checks --username account
3+
bind --service-name customer
4+
bind --service-name customer32 --username customer
5+
bind --service-name testrunner --username account
6+
deploy --service-name account --artifact-path account/target/account-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
7+
deploy --service-name checks --artifact-path checks/target/checks-0.0.1-SNAPSHOT.jar --image-version 0.0.1
8+
deploy --service-name customer --artifact-path customer/target/customer-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
9+
deploy --service-name customer32 --artifact-path customer32/target/customer32-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
10+
deploy --service-name creditscore --artifact-path creditscore/target/creditscore-0.0.1-SNAPSHOT.jar --image-version 0.0.1
11+
deploy --service-name testrunner --artifact-path testrunner/target/testrunner-0.0.1-SNAPSHOT.jar --image-version 0.0.1
12+
deploy --service-name transfer --artifact-path transfer/target/transfer-0.0.1-SNAPSHOT.jar --image-version 0.0.1

cloudbank-v32/deploy-cmds/deploy-cb32.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)