You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -45,64 +45,7 @@ Complete the following prerequisites to successfully walk through this guide.
45
45
* Be sure to follow the steps in "Install the OpenShift CLI" because we'll use the `oc` command later in this article.
46
46
* Write down the cluster console URL. It will look like `https://console-openshift-console.apps.<random>.<region>.aroapp.io/`.
47
47
* Take note of the `kubeadmin` credentials.
48
-
49
-
1. Verify you can sign in to the OpenShift CLI with the token for user `kubeadmin`.
50
-
51
-
### Configure Azure Active Directory authentication
52
-
53
-
Azure Active Directory (Azure AD) implements OpenID Connect (OIDC). OIDC lets you use Azure AD to sign in to the ARO cluster. Follow the steps in [Configure Azure Active Directory authentication](configure-azure-ad-cli.md) to set up your cluster.
54
-
55
-
After you complete the setup, return to this document and sign in to the cluster with an Azure AD user.
56
-
57
-
1. Sign in to the OpenShift web console from your browser using the credentials of an Azure AD user. We'll leverage the OpenShift OpenID authentication against Azure Active Directory to use OpenID to define the administrator.
58
-
59
-
1. Use an InPrivate, Incognito or other equivalent browser window feature to sign in to the console. The window will look different after having enabled OIDC.
60
-
61
-
:::image type="content" source="media/built-in-container-registry/oidc-enabled-login-window.png" alt-text="OpenID Connect enabled sign in window.":::
62
-
1. Select **AAD**
63
-
64
-
> [!NOTE]
65
-
> Take note of the username and password you use to sign in here. This username and password will function as an administrator for other actions in this article.
66
-
1. Sign in with the OpenShift CLI by using the following steps. For discussion, this process is known as `oc login`.
67
-
1. At the right-top of the web console, expand the context menu of the signed-in user, then select **Copy Login Command**.
68
-
1. Sign in to a new tab window with the same user if necessary.
69
-
1. Select **Display Token**.
70
-
1. Copy the value listed below **Login with this token** to the clipboard and run it in a shell, as shown here.
1. Run `oc whoami`in the console and note the output as **\<aad-user>**. We'll use this value later in the article.
77
-
1. Sign out of the OpenShift web console. Select the button in the top right of the browser window labeled as the **\<aad-user>** and choose **Log Out**.
78
-
79
-
### Create an OpenShift namespace for the Java app
80
-
81
-
1. Sign in to the OpenShift web console from your browser using the `kubeadmin` credentials.
82
-
2. Navigate to **Administration** > **Namespaces** > **Create Namespace**.
83
-
3. Fill in `open-liberty-demo` for **Name** and select **Create**, as shown next.
Besides image management, the **aad-user** will also be granted administrative permissions for managing resources in the demo project of the ARO 4 cluster. Sign in to the OpenShift CLI and grant the **aad-user** the necessary privileges by following these steps.
90
-
91
-
1. Sign in to the OpenShift web console from your browser using the `kubeadmin` credentials.
92
-
1. At the right-top of the web console, expand the context menu of the signed-in user, then select **Copy Login Command**.
93
-
1. Sign in to a new tab window with the same user if necessary.
94
-
1. Select **Display Token**.
95
-
1. Copy the value listed below **Login with this token** to the clipboard and run it in a shell, as shown here.
96
-
1. Execute the following commands to grant `admin` role to the **aad-user** in namespace `open-liberty-demo`.
97
-
98
-
```bash
99
-
# Switch to project "open-liberty-demo"
100
-
oc project open-liberty-demo
101
-
Now using project "open-liberty-demo" on server "https://api.x8xl3f4y.eastus.aroapp.io:6443".
* Be sure to follow the steps in "Connect using the OpenShift CLI" with the `kubeadmin` credentials.
106
49
107
50
### Install the Open Liberty OpenShift Operator
108
51
@@ -120,6 +63,16 @@ After creating and connecting to the cluster, install the Open Liberty Operator.
120
63
121
64
:::image type="content" source="media/howto-deploy-java-liberty-app/open-liberty-operator-installed.png" alt-text="Installed Operators showing Open Liberty is installed.":::
122
65
66
+
### Create an OpenShift namespace for the Java app
67
+
68
+
Follow the instructions below to create an OpenShift namespace for use with your app.
69
+
70
+
1. Make sure you have signed in to the OpenShift web console from your browser using the `kubeadmin` credentials.
71
+
2. Navigate to **Administration** > **Namespaces** > **Create Namespace**.
72
+
3. Fill in `open-liberty-demo` for **Name** and select **Create**, as shown next.
Follow the instructions below to set up an Azure Database for MySQL for use with your app. If your application doesn't require a database, you can skip this section.
@@ -202,7 +155,7 @@ cd <path-to-your-repo>/open-liberty-on-aro/3-integration/connect-db/mysql
@@ -264,31 +217,11 @@ Complete the following steps to build the application image:
264
217
265
218
# [with DB connection](#tab/with-mysql-image)
266
219
267
-
### Log in to the OpenShift CLI as the Azure AD user
268
-
269
-
Since you have already successfully run the app in the Liberty Docker container, sign in to the OpenShift CLI as the Azure AD user in order to build image remotely on the cluster.
270
-
271
-
1. Sign in to the OpenShift web console from your browser using the credentials of an Azure AD user.
272
-
273
-
1. Use an InPrivate, Incognito or other equivalent browser window feature to sign in to the console.
274
-
1. Select **AAD**
275
-
276
-
> [!NOTE]
277
-
> Take note of the username and password you use to sign in here. This username and password will functionas an administrator forother actionsin this and other articles.
278
-
1. Sign in with the OpenShift CLI by using the following steps. For discussion, this process is known as `oc login`.
279
-
1. At the right-top of the web console, expand the context menu of the signed-in user, thenselect**Copy Login Command**.
280
-
1. Sign in to a new tab window with the same user if necessary.
281
-
1. Select **Display Token**.
282
-
1. Copy the value listed below **Login with this token** to the clipboard and run it in a shell, as shown here.
### Build the application and push to the image stream
289
221
290
-
Next, you're going to build the image remotely on the cluster by executing the following commands.
222
+
Since you have already successfully run the app in the Liberty Docker container, you're going to build the image remotely on the cluster by executing the following commands.
291
223
224
+
1. Make sure you have already signed in to the OpenShift CLI using the `kubeadmin` credentials.
292
225
1. Identify the source directory and Dockerfile.
293
226
294
227
```bash
@@ -352,31 +285,11 @@ Before deploying the containerized application to a remote cluster, build and ru
352
285
1. Open `http://localhost:9080/`in your browser to visit the application home page.
353
286
1. Press **Control-C** to stop the application and Liberty server.
354
287
355
-
### Log in to the OpenShift CLI as the Azure AD user
356
-
357
-
When you're satisfied with the state of the application, sign in to the OpenShift CLI as the Azure AD user in order to build image remotely on the cluster.
358
-
359
-
1. Sign in to the OpenShift web console from your browser using the credentials of an Azure AD user.
360
-
361
-
1. Use an InPrivate, Incognito or other equivalent browser window feature to sign in to the console.
362
-
1. Select **AAD**
363
-
364
-
> [!NOTE]
365
-
> Take note of the username and password you use to sign in here. This username and password will functionas an administrator forother actionsin this and other articles.
366
-
1. Sign in with the OpenShift CLI by using the following steps. For discussion, this process is known as `oc login`.
367
-
1. At the right-top of the web console, expand the context menu of the signed-in user, thenselect**Copy Login Command**.
368
-
1. Sign in to a new tab window with the same user if necessary.
369
-
1. Select **Display Token**.
370
-
1. Copy the value listed below **Login with this token** to the clipboard and run it in a shell, as shown here.
### Build the application and push to the image stream
377
289
378
-
Next, you're going to build the image remotely on the cluster by executing the following commands.
290
+
When you're satisfied with the state of the application, you're going to build the image remotely on the cluster by executing the following commands.
379
291
292
+
1. Make sure you have already signed in to the OpenShift CLI using the `kubeadmin` credentials.
380
293
1. Identity the source directory and the Dockerfile.
381
294
382
295
```bash
@@ -412,13 +325,14 @@ Next, you're going to build the image remotely on the cluster by executing the f
412
325
## Deploy application on the ARO 4 cluster
413
326
414
327
Now you can deploy the sample Liberty application to the Azure Red Hat OpenShift 4 cluster you created earlier when working through the prerequisites.
328
+
415
329
# [with DB from web console](#tab/with-mysql-deploy-console)
416
330
417
331
### Deploy the application from the web console
418
332
419
333
Because we use the Open Liberty Operator to manage Liberty applications, we need to create an instance of its *Custom Resource Definition*, of type"OpenLibertyApplication". The Operator will then take care of all aspects of managing the OpenShift resources required for deployment.
420
334
421
-
1. Sign in to the OpenShift web console from your browser using the credentials of the Azure AD user.
335
+
1. Sign in to the OpenShift web console from your browser using the `kubeadmin` credentials.
1. Navigate to **Operators**>**Installed Operators**.
424
338
1. In the middle of the page, select**Open Liberty Operator**.
@@ -448,8 +362,8 @@ You'll see the application home page opened in the browser.
448
362
Instead of using the web console GUI, you can deploy the application from the CLI. If you haven't already done so, download and install the `oc` command-line tool by following the steps in Red Hat documentation: [Getting Started with the CLI](https://docs.openshift.com/container-platform/4.2/cli_reference/openshift_cli/getting-started-cli.html).
449
363
450
364
Now you can deploy the sample Liberty application to the ARO 4 cluster with the following steps.
451
-
1. Log in to the OpenShift web console from your browser using the credentials of the Azure AD user.
452
-
1. [Log in to the OpenShift CLI with the token for the Azure AD user](https://github.com/Azure-Samples/open-liberty-on-aro/blob/master/guides/howto-deploy-java-liberty-app.md#log-in-to-the-openshift-cli-with-the-token).
365
+
366
+
1. Make sure you have already signed in to the OpenShift CLI using the `kubeadmin` credentials.
453
367
1. Run the following commands to deploy the application.
454
368
```bash
455
369
# Change directory to "<path-to-repo>/3-integration/connect-db/mysql/target"
@@ -483,7 +397,7 @@ Once the Liberty application is up and running, open the output of **Route Host*
483
397
484
398
Because we use the Open Liberty Operator to manage Liberty applications, we need to create an instance of its *Custom Resource Definition*, of type"OpenLibertyApplication". The Operator will then take care of all aspects of managing the OpenShift resources required for deployment.
485
399
486
-
1. Sign in to the OpenShift web console from your browser using the credentials of the Azure AD user.
400
+
1. Sign in to the OpenShift web console from your browser using the `kubeadmin` credentials.
1. Navigate to **Operators**>**Installed Operators**.
489
403
1. In the middle of the page, select**Open Liberty Operator**.
@@ -516,9 +430,8 @@ When you're done with the application, follow these steps to delete the applicat
516
430
517
431
Instead of using the web console GUI, you can deploy the application from the CLI. If you haven't already done so, download and install the `oc` command-line tool by following Red Hat documentation [Getting Started with the CLI](https://docs.openshift.com/container-platform/4.2/cli_reference/openshift_cli/getting-started-cli.html).
518
432
519
-
1. Sign in to the OpenShift web console from your browser using the credentials of the Azure AD user.
520
-
2. Sign in to the OpenShift CLI with the token for the Azure AD user.
521
-
3. Change directory to `2-simple` of your local clone, and run the following commands to deploy your Liberty application to the ARO 4 cluster. Command output is also shown inline.
433
+
1. Make sure you have already signed in to the OpenShift CLI using the `kubeadmin` credentials.
434
+
1. Change directory to `2-simple` of your local clone, and run the following commands to deploy your Liberty application to the ARO 4 cluster. Command output is also shown inline.
522
435
523
436
```bash
524
437
# Switch to namespace "open-liberty-demo" where resources of demo app will belong to
@@ -544,8 +457,8 @@ Instead of using the web console GUI, you can deploy the application from the CL
544
457
javaee-cafe-simple 1/1 1 0 102s
545
458
```
546
459
547
-
4. Check to see `1/1` under the `READY` column before you continue. If not, investigate and resolve the problem before continuing.
548
-
5. Discover the host of route to the application with the `oc get route` command, as shown here.
460
+
1. Check to see `1/1` under the `READY` column before you continue. If not, investigate and resolve the problem before continuing.
461
+
1. Discover the host of route to the application with the `oc get route` command, as shown here.
0 commit comments