@@ -85,9 +85,9 @@ However, when you are targeting OpenShift, you might want to trim the capabiliti
85
85
Navigate to your demo application local repository and change the branch to `bootable-jar`:
86
86
87
87
```bash
88
- jboss-on-aro-jakartaee (main) $ git checkout bootable-jar
88
+ $ git checkout bootable-jar
89
89
Switched to branch ' bootable-jar'
90
- jboss-on-aro-jakartaee (bootable-jar) $
90
+ $
91
91
```
92
92
93
93
Let' s do a quick review about what we have changed:
@@ -133,14 +133,14 @@ Follow the next steps to build and run the application locally.
133
133
1. Build the Bootable JAR. When we are building the Bootable JAR, we need to specify the database driver version we want to use:
134
134
135
135
```bash
136
- jboss-on-aro-jakartaee (bootable-jar) $ MSSQLSERVER_DRIVER_VERSION=7.4.1.jre11 \
136
+ $ MSSQLSERVER_DRIVER_VERSION=7.4.1.jre11 \
137
137
mvn clean package
138
138
```
139
139
140
140
1. Launch the Bootable JAR by using the following command. When we are launching the application, we need to pass the required environment variables to configure the data source:
141
141
142
142
```bash
143
- jboss-on-aro-jakartaee (bootable-jar) $ MSSQLSERVER_USER=SA \
143
+ $ MSSQLSERVER_USER=SA \
144
144
MSSQLSERVER_PASSWORD=Passw0rd! \
145
145
MSSQLSERVER_JNDI=java:/comp/env/jdbc/mssqlds \
146
146
MSSQLSERVER_DATABASE=todos_db \
@@ -154,7 +154,7 @@ Follow the next steps to build and run the application locally.
154
154
1. (Optional) If you want to verify the clustering capabilities, you can also launch more instances of the same application by passing to the Bootable JAR the `jboss.node.name` argument and, to avoid conflicts with the port numbers, shifting the port numbers by using `jboss.socket.binding.port-offset`. For example, to launch a second instance that will represent a new pod on OpenShift, you can execute the following command in a new terminal window:
155
155
156
156
```bash
157
- jboss-on-aro-jakartaee (bootable-jar) $ MSSQLSERVER_USER=SA \
157
+ $ MSSQLSERVER_USER=SA \
158
158
MSSQLSERVER_PASSWORD=Passw0rd! \
159
159
MSSQLSERVER_JNDI=java:/comp/env/jdbc/mssqlds \
160
160
MSSQLSERVER_DATABASE=todos_db \
@@ -179,10 +179,10 @@ Follow the next steps to build and run the application locally.
179
179
1. Check the application health endpoints (live and ready). These endpoints will be used by OpenShift to verify when your pod is live and ready to receive user requests:
180
180
181
181
```bash
182
- jboss-on-aro-jakartaee (bootable-jar) $ curl http://localhost:9990/health/live
182
+ $ curl http://localhost:9990/health/live
183
183
{"status":"UP","checks":[{"name":"SuccessfulCheck","status":"UP"}]}
184
184
185
- jboss-on-aro-jakartaee (bootable-jar) $ curl http://localhost:9990/health/ready
185
+ $ curl http://localhost:9990/health/ready
186
186
{"status":"UP","checks":[{"name":"deployments-status","status":"UP","data":{"todo-list.war":"OK"}},{"name":"server-state","status":"UP","data":{"value":"running"}},{"name":"boot-errors","status":"UP"},{"name":"DBConnectionHealthCheck","status":"UP"}]}
187
187
```
188
188
@@ -217,9 +217,9 @@ To deploy the application, we are going to use the JBoss EAP Helm Charts already
217
217
Navigate to your demo application local repository and change the current branch to ` bootable-jar-openshift` :
218
218
219
219
` ` ` bash
220
- jboss-on-aro-jakartaee (bootable-jar) $ git checkout bootable-jar-openshift
220
+ $ git checkout bootable-jar-openshift
221
221
Switched to branch ' bootable-jar-openshift'
222
- jboss-on-aro-jakartaee (bootable-jar-openshift) $
222
+ $
223
223
` ` `
224
224
225
225
Let' s do a quick review about what we have changed:
@@ -240,7 +240,7 @@ This file expects the presence of an OpenShift Secret object named `mssqlserver-
240
240
1. To create the Secret object with the information relative to the database, execute the following command on the `eap-demo` project created before at the pre-requisite steps section:
241
241
242
242
```bash
243
- jboss-on-aro-jakartaee (bootable-jar-openshift) $ oc create secret generic mssqlserver-secret \
243
+ $ oc create secret generic mssqlserver-secret \
244
244
--from-literal db-password=Passw0rd! \
245
245
--from-literal db-user=sa \
246
246
--from-literal db-name=todos_db
@@ -250,7 +250,7 @@ This file expects the presence of an OpenShift Secret object named `mssqlserver-
250
250
1. Deploy the database server by executing the following:
251
251
252
252
```bash
253
- jboss-on-aro-jakartaee (bootable-jar-openshift) $ oc apply -f ./deployment/msqlserver/mssqlserver.yaml
253
+ $ oc apply -f ./deployment/msqlserver/mssqlserver.yaml
254
254
service/mssqlserver created
255
255
deploymentconfig.apps.openshift.io/mssqlserver created
256
256
persistentvolumeclaim/mssqlserver-pvc created
@@ -259,7 +259,7 @@ This file expects the presence of an OpenShift Secret object named `mssqlserver-
259
259
1. Monitor the status of the pods and wait until the database server is running:
260
260
261
261
```bash
262
- jboss-on-aro-jakartaee (bootable-jar-openshift) $ oc get pods -w
262
+ $ oc get pods -w
263
263
NAME READY STATUS RESTARTS AGE
264
264
mssqlserver-1-deploy 0/1 Completed 0 34s
265
265
mssqlserver-1-gw7qw 1/1 Running 0 31s
@@ -268,7 +268,7 @@ This file expects the presence of an OpenShift Secret object named `mssqlserver-
268
268
1. Connect to the database pod and create the database `todos_db`:
269
269
270
270
```bash
271
- jboss-on-aro-jakartaee (bootable-jar-openshift) $ oc rsh mssqlserver-1-gw7qw
271
+ $ oc rsh mssqlserver-1-gw7qw
272
272
sh-4.4$ /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P ' Passw0rd! '
273
273
1> CREATE DATABASE todos_db
274
274
2> GO
@@ -286,7 +286,7 @@ Before deploying the application, let's create the expected Secret object that w
286
286
1. Execute the following to create the OpenShift secret object that will hold the application configuration:
287
287
288
288
` ` ` bash
289
- jboss-on-aro-jakartaee (bootable-jar-openshift) $ oc create secret generic todo-list-secret \
289
+ $ oc create secret generic todo-list-secret \
290
290
--from-literal app-driver-version=7.4.1.jre11 \
291
291
--from-literal app-ds-jndi=java:/comp/env/jdbc/mssqlds \
292
292
--from-literal app-cluster-password=mut2UTG6gDwNDcVW
@@ -353,7 +353,7 @@ Select **Uninstall Helm Release** to remove the application. Notice that the sec
353
353
Execute the following command if you want to delete the secret that holds the application configuration:
354
354
355
355
` ` ` bash
356
- jboss-on-aro-jakartaee (bootable-jar-openshift) $ oc delete secrets/todo-list-secret
356
+ $ oc delete secrets/todo-list-secret
357
357
secret " todo-list-secret" deleted
358
358
` ` `
359
359
@@ -362,12 +362,12 @@ secret "todo-list-secret" deleted
362
362
If you want to delete the database and the related objects, execute the following command:
363
363
364
364
` ` ` bash
365
- jboss-on-aro-jakartaee (bootable-jar-openshift) $ oc delete all -l app=mssql2019
365
+ $ oc delete all -l app=mssql2019
366
366
replicationcontroller " mssqlserver-1" deleted
367
367
service " mssqlserver" deleted
368
368
deploymentconfig.apps.openshift.io " mssqlserver" deleted
369
369
370
- jboss-on-aro-jakartaee (bootable-jar-openshift) $ oc delete secrets/mssqlserver-secret
370
+ $ oc delete secrets/mssqlserver-secret
371
371
secret " mssqlserver-secret" deleted
372
372
` ` `
373
373
@@ -376,7 +376,7 @@ secret "mssqlserver-secret" deleted
376
376
You can also delete all the configuration created for this demo by deleting the ` eap-demo` project. To do so, execute the following:
377
377
378
378
` ` ` bash
379
- jboss-on-aro-jakartaee (bootable-jar-openshift) $ oc delete project eap-demo
379
+ $ oc delete project eap-demo
380
380
project.project.openshift.io " eap-demo" deleted
381
381
` ` `
382
382
0 commit comments