@@ -162,6 +162,28 @@ deploy --service-name testrunner --artifact-path testrunner/target/testrunner-0.
162
162
deploy --service-name transfer --artifact-path transfer/target/transfer-0.0.1-SNAPSHOT.jar --image-version 0.0.1
163
163
` ` `
164
164
165
+ # # Create APISIX Routes
166
+
167
+ 1. Get APISIX Gateway Admin Key
168
+
169
+ ` ` ` shell
170
+ kubectl -n apisix get configmap apisix -o yaml
171
+ ` ` `
172
+
173
+ 1. Create tunnel to APISIX
174
+
175
+ ` ` ` shell
176
+ kubectl port-forward -n apisix svc/apisix-admin 9180
177
+ ` ` `
178
+
179
+ 1. Create routes
180
+
181
+ In the CloudBank directory run the following command. * NOTE* , you must add the API-KEY to the command
182
+
183
+ ` ` ` ` shell
184
+ cd apisix-routes; source ./create-all-routes.sh < YOUR-API-KEY> ; cd ..
185
+ ` ` `
186
+
165
187
# # Optional - autoscaling
166
188
167
189
Create autoscalers for CloudBank.
@@ -192,18 +214,25 @@ This is an example of the `customer32` application:
192
214
193
215
# # Test CloudBank Services
194
216
195
- 1. Test ` account` service
196
-
197
- 1. Port forward
217
+ 1. Get the external IP address
218
+
219
+ ` ` ` shell
220
+ kubectl -n ingress-nginx get service ingress-nginx-controller
221
+ ` ` `
222
+
223
+ Result. Make a note of the EXTERNAL-IP it will be used in the tests.
224
+ 2.
225
+ ` ` ` text
226
+ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
227
+ ingress-nginx-controller LoadBalancer 10.96.172.148 146.235.207.230 80:31393/TCP,443:30506/TCP 158m
228
+ ` ` `
198
229
199
- ` ` ` shell
200
- kubectl port-forward -n application svc/account 8081:8080
201
- ` ` `
230
+ 1. Test ` account` service
202
231
203
232
1. Rest endpoint
204
233
205
234
` ` ` shell
206
- curl -s http://localhost:8081 /api/v1/accounts | jq
235
+ curl -s http://< EXTERNAL-IP > /api/v1/accounts | jq
207
236
` ` `
208
237
209
238
Should return:
@@ -213,7 +242,7 @@ This is an example of the `customer32` application:
213
242
{
214
243
" accountBalance" : -20,
215
244
" accountCustomerId" : " qwertysdwr" ,
216
- " accountId" : 149 ,
245
+ " accountId" : 1 ,
217
246
" accountName" : " Andy's checking" ,
218
247
" accountOpenedDate" : " 2023-06-26T17:39:37.000+00:00" ,
219
248
" accountOtherDetails" : " Account Info" ,
@@ -225,16 +254,10 @@ This is an example of the `customer32` application:
225
254
226
255
1. Test ` customer` service
227
256
228
- 1. Port forward
229
-
230
- ` ` ` shell
231
- kubectl port-forward -n application svc/customer 8082:8080
232
- ` ` `
233
-
234
257
1. REST endpoint
235
258
236
259
` ` ` shell
237
- curl -s http://localhost:8082 /api/v1/customer | jq
260
+ curl -s http://< EXTERNAL-IP > /api/v1/customer | jq
238
261
` ` `
239
262
240
263
Should return:
@@ -255,16 +278,10 @@ This is an example of the `customer32` application:
255
278
256
279
1. Test ` customer32` service
257
280
258
- 1. Port forward
259
-
260
- ` ` ` shell
261
- kubectl port-forward -n application svc/customer32 9000:8080
262
- ` ` `
263
-
264
281
1. REST endpoint
265
282
266
283
` ` ` shell
267
- curl -s http://localhost:9000 /api/v2/customer | jq
284
+ curl -s http://< EXTERNAL-IP > /api/v2/customer | jq
268
285
` ` `
269
286
270
287
Should return:
@@ -282,16 +299,10 @@ This is an example of the `customer32` application:
282
299
283
300
1. Test ` creditscore` service
284
301
285
- 1. Port forward
286
-
287
- ` ` ` shell
288
- kubectl port-forward -n application svc/creditscore 8083:8080
289
- ` ` ` ` ` `
290
-
291
302
1. REST endpoint
292
303
293
304
` ` ` shell
294
- curl -s http://localhost:8083 /api/v1/creditscore | jq
305
+ curl -s http://< EXTERNAL-IP > /api/v1/creditscore | jq
295
306
` ` `
296
307
297
308
Should return:
@@ -305,16 +316,10 @@ This is an example of the `customer32` application:
305
316
306
317
1. Test ` check` service
307
318
308
- 1. Port forward
309
-
310
- ` ` ` shell
311
- kubectl -n application port-forward svc/testrunner 8084:8080
312
- ` ` `
313
-
314
- 1. REST endpoint - deposit check. Make sure you use an existing account number
319
+ 1. REST endpoint - deposit check. * NOTE* : Make sure you use an existing account number
315
320
316
321
` ` ` shell
317
- curl -i -X POST -H ' Content-Type: application/json' -d ' {"accountId": 21 , "amount": 256}' http://localhost:8084 /api/v1/testrunner/deposit
322
+ curl -i -X POST -H ' Content-Type: application/json' -d ' {"accountId": 1 , "amount": 256}' http://< EXTERNAL-IP > /api/v1/testrunner/deposit
318
323
` ` `
319
324
320
325
Should return:
@@ -340,10 +345,10 @@ This is an example of the `customer32` application:
340
345
Received deposit < CheckDeposit(accountId=21, amount=256)>
341
346
` ` `
342
347
343
- 1. Check journal entries. Replace ' 21 ' with the account number you used.
348
+ 1. Check journal entries. Replace ' 1 ' with the account number you used.
344
349
345
350
` ` ` shell
346
- curl -i http://localhost:8081 /api/v1/account/21 /journal
351
+ curl -i http://< EXTERNAL-ID > /api/v1/account/1 /journal
347
352
` ` `
348
353
349
354
output should be similar to:
@@ -360,7 +365,7 @@ This is an example of the `customer32` application:
360
365
1. Clearance of check - Note the JournalID from earlier step
361
366
362
367
` ` ` shell
363
- curl -i -X POST -H ' Content-Type: application/json' -d ' {"journalId": 7}' http://localhost:8084 /api/v1/testrunner/clear
368
+ curl -i -X POST -H ' Content-Type: application/json' -d ' {"journalId": 7}' http://< EXTERNAL-ID > /api/v1/testrunner/clear
364
369
` ` `
365
370
366
371
output should be similar to:
@@ -391,7 +396,7 @@ This is an example of the `customer32` application:
391
396
1. Check journal -- DEPOSIT
392
397
393
398
` ` ` shell
394
- curl -i http://localhost:8081 /api/v1/account/21/journal
399
+ curl -i http://< EXTERNAL-IP > /api/v1/account/21/journal
395
400
` ` `
396
401
397
402
Output should look like this -- DEPOSIT
@@ -407,23 +412,17 @@ This is an example of the `customer32` application:
407
412
408
413
1. Run LRA Test Cases
409
414
410
- 1. Port forward
415
+ 1. Check account balances. Note that the account numbers 1 and 2 can be different in your environment
411
416
412
417
` ` ` shell
413
- kubectl -n application port-forward svc/transfer 8085:8080
418
+ curl -s http:// < EXTERNAL-IP > /api/v1/account/1 | jq ; curl -s http:// < EXTERNAL-IP > /api/v1/account/2 | jq
414
419
` ` `
415
420
416
- 1. Check account balances. Note that the account numbers 21 and 22 can be different in your environment
417
-
418
- ` ` ` shell
419
- curl -s http://localhost:8081/api/v1/account/21 | jq ; curl -s http://localhost:8081/api/v1/account/22 | jq
420
- ` ` `
421
-
422
- Output should be similar to this:
421
+ Output should be similar to this, make a note of the account balance:
423
422
424
423
` ` ` json
425
424
{
426
- " accountId" : 21 ,
425
+ " accountId" : 1 ,
427
426
" accountName" : " Andy's checking" ,
428
427
" accountType" : " CH" ,
429
428
" accountCustomerId" : " qwertysdwr" ,
@@ -432,7 +431,7 @@ This is an example of the `customer32` application:
432
431
" accountBalance" : -20
433
432
},
434
433
{
435
- " accountId" : 22 ,
434
+ " accountId" : 2 ,
436
435
" accountName" : " Mark's CCard" ,
437
436
" accountType" : " CC" ,
438
437
" accountCustomerId" : " bkzLp8cozi" ,
@@ -445,7 +444,7 @@ This is an example of the `customer32` application:
445
444
1. Perform transfer between two accounts. Note account numbers
446
445
447
446
` ` ` shell
448
- curl -X POST " http://localhost:8085 /transfer?fromAccount=22&toAccount=21&amount=100"
447
+ curl -X POST " http://<EXTERNAL-IP> /transfer?fromAccount=22&toAccount=21&amount=100"
449
448
` ` `
450
449
451
450
Output should look like this:
@@ -457,14 +456,14 @@ This is an example of the `customer32` application:
457
456
1. Check accounts to see that the transfer have occurred
458
457
459
458
` ` ` shell
460
- curl -s http://localhost:8081 /api/v1/account/21 | jq ; curl -s http://localhost:8081 /api/v1/account/22 | jq
459
+ curl -s http://< EXTERNAL-IP > /api/v1/account/1 | jq ; curl -s http://< EXTERNAL-IP > /api/v1/account/2 | jq
461
460
` ` `
462
461
463
462
Output should be similar to this:
464
463
465
464
` ` ` json
466
465
{
467
- " accountId" : 21 ,
466
+ " accountId" : 1 ,
468
467
" accountName" : " Andy's checking" ,
469
468
" accountType" : " CH" ,
470
469
" accountCustomerId" : " qwertysdwr" ,
@@ -473,7 +472,7 @@ This is an example of the `customer32` application:
473
472
" accountBalance" : 80
474
473
},
475
474
{
476
- " accountId" : 22 ,
475
+ " accountId" : 2 ,
477
476
" accountName" : " Mark's CCard" ,
478
477
" accountType" : " CC" ,
479
478
" accountCustomerId" : " bkzLp8cozi" ,
0 commit comments