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
> You can also execute this guidance from the [Azure Cloud Shell](/azure/cloud-shell/quickstart). This approach has all the prerequisite tools pre-installed, with the exception of Docker.
36
-
>
37
-
> :::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com":::
38
-
39
-
* Prepare a local machine with a Unix-like operating system installed (for example, Ubuntu, macOS, Windows Subsystem for Linux).
40
-
* This article requires at least version 2.31.0 of Azure CLI.
34
+
* Install the [Azure CLI](/cli/azure/install-azure-cli). If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see [How to run the Azure CLI in a Docker container](/cli/azure/run-azure-cli-docker).
35
+
* Sign in to the Azure CLI by using the [az login](/cli/azure/reference-index#az-login) command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see [Sign in with the Azure CLI](/cli/azure/authenticate-azure-cli).
36
+
* When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see [Use extensions with the Azure CLI](/cli/azure/azure-cli-extensions-overview).
37
+
* Run [az version](/cli/azure/reference-index?#az-version) to find the version and dependent libraries that are installed. To upgrade to the latest version, run [az upgrade](/cli/azure/reference-index?#az-upgrade). This article requires at least version 2.31.0 of Azure CLI.
41
38
* Install a Java SE implementation, version 17 or later. (for example, [Eclipse Open J9](https://www.eclipse.org/openj9/)).
42
39
* Install [Maven](https://maven.apache.org/download.cgi) 3.5.0 or higher.
43
40
* Install [Docker](https://docs.docker.com/get-docker/) for your OS.
41
+
* Ensure [Git](https://git-scm.com) is installed.
44
42
* Make sure you're assigned either the `Owner` role or the `Contributor` and `User Access Administrator` roles in the subscription. You can verify it by following steps in [List role assignments for a user or group](../role-based-access-control/role-assignments-list-portal.md#list-role-assignments-for-a-user-or-group).
45
43
44
+
> [!NOTE]
45
+
> You can also execute this guidance from the [Azure Cloud Shell](/azure/cloud-shell/quickstart). This approach has all the prerequisite tools pre-installed, with the exception of Docker.
46
+
>
47
+
> :::image type="icon" source="~/reusable-content/ce-skilling/azure/media/cloud-shell/launch-cloud-shell-button.png" alt-text="Button to launch the Azure Cloud Shell." border="false" link="https://shell.azure.com":::
48
+
46
49
## Create a Liberty on AKS deployment using the portal
47
50
48
51
The following steps guide you to create a Liberty runtime on AKS. After completing these steps, you have an Azure Container Registry and an Azure Kubernetes Service cluster for deploying your containerized application.
49
52
50
-
1. Visit the [Azure portal](https://portal.azure.com/). In the search box at the top of the page, type *IBM WebSphere Liberty and Open Liberty on Azure Kubernetes Service*. When the suggestions start appearing, select the one and only match that appears in the **Marketplace** section. If you prefer, you can go directly to the offer with this shortcut link: [https://aka.ms/liberty-aks](https://aka.ms/liberty-aks).
53
+
1. Visit the [Azure portal](https://portal.azure.com/). In the search box at the top of the page, type *IBM Liberty on AKS*. When the suggestions start appearing, select the one and only match that appears in the **Marketplace** section. If you prefer, you can go directly to the offer with this shortcut link: [https://aka.ms/liberty-aks](https://aka.ms/liberty-aks).
51
54
52
55
1. Select **Create**.
53
56
@@ -56,29 +59,27 @@ The following steps guide you to create a Liberty runtime on AKS. After completi
56
59
1. Create a new resource group. Because resource groups must be unique within a subscription, pick a unique name. An easy way to have unique names is to use a combination of your initials, today's date, and some identifier. For example, `ejb0913-java-liberty-project-rg`.
57
60
1. Select *East US* as **Region**.
58
61
59
-
Create environment variables in your shell for the resource group names for the cluster and the database.
62
+
Create environment variables in your shell for the resource group name for the cluster.
1. Select **Next**, enter the **AKS** pane. This pane allows you to selectan existing AKS cluster and Azure Container Registry (ACR), instead of causing the deployment to create a new one, if desired. This capability enables you to use the sidecar pattern, as shown in the [Azure architecture center](/azure/architecture/patterns/sidecar). You can also adjust the settings forthe size and number of the virtual machinesin the AKS node pool. The remaining values do not need to be changed from their default values.
78
+
1. Select **Next**, enter the **AKS** pane. This pane allows you to selectan existing AKS cluster and Azure Container Registry (ACR), instead of causing the deployment to create a new one, if desired. This capability enables you to use the sidecar pattern, as shown in the [Azure architecture center](/azure/architecture/patterns/sidecar). You can also adjust the settings forthe size and number of the virtual machinesin the AKS node pool. For our purposes, just keep all the defaults on this pane.
78
79
79
80
1. Select **Next**, enter the **Load Balancing** pane. Next to **Connect to Azure Application Gateway?**select**Yes**. This section lets you customize the following deployment options.
80
81
81
-
1. You can customize the **virtual network** and **subnet** into which the deployment will place the resources. The remaining values do not need to be changed from their default values.
82
+
1. You can optionally customize the **virtual network** and **subnet** into which the deployment places the resources. The remaining values don't need to be changed from their default values.
82
83
1. You can provide the **TLS/SSL certificate** presented by the Azure Application Gateway. Leave the values at the default to cause the offer to generate a self-signed certificate. Don't go to production using a self-signed certificate. For more information about self-signed certificates, see [Create a self-signed public certificate to authenticate your application](../active-directory/develop/howto-create-self-signed-certificate.md).
83
84
1. You can select**Enable cookie based affinity**, also known as sticky sessions. We want sticky sessions enabled for this article, so ensure this option is selected.
84
85
@@ -91,7 +92,7 @@ The following steps guide you to create a Liberty runtime on AKS. After completi
91
92
92
93
## Capture selected information from the deployment
93
94
94
-
If you navigated away from the **Deployment is in progress** page, the following steps will show you how to get back to that page. If you're still on the page that shows **Your deployment is complete**, you can skip to the third step.
95
+
If you navigated away from the **Deployment is in progress** page, the following steps show you how to get back to that page. If you're still on the page that shows **Your deployment is complete**, go to the newly created resource group and skip to the third step.
95
96
96
97
1. In the upper left of any portal page, selectthe hamburger menu and select**Resource groups**.
97
98
1. In the box with the text **Filter for any field**, enter the first few characters of the resource group you created previously. If you followed the recommended convention, enter your initials, thenselectthe appropriate resource group.
@@ -100,7 +101,7 @@ If you navigated away from the **Deployment is in progress** page, the following
100
101
1. Save aside the values for**Login server**, **Registry name**, **Username**, and **password**. You may use the copy icon at the right of each field to copy the value of that field to the system clipboard.
101
102
1. Navigate again to the resource group into which you deployed the resources.
102
103
1. In the **Settings** section, select**Deployments**.
103
-
1. Select the bottom-most deployment in the list. The **Deployment name** will match the publisher ID of the offer. It will contain the string `ibm`.
104
+
1. Select the bottom-most deployment in the list. The **Deployment name**matches the publisher ID of the offer. It contains the string `ibm`.
104
105
1. In the left pane, select**Outputs**.
105
106
1. Using the same copy technique as with the preceding values, save aside the values for the following outputs:
106
107
@@ -109,15 +110,15 @@ If you navigated away from the **Deployment is in progress** page, the following
109
110
110
111
### [Bash](#tab/in-bash)
111
112
112
-
Paste the value of `appDeploymentTemplateYaml` or `appDeploymentYaml` into a Bash shell, append `| grep secretName`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
113
+
Paste the value of `appDeploymentTemplateYaml` or `appDeploymentYaml` into a Bash shell, append `| grep secretName`, and execute. This commandoutputs the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for`secretName` from the output.
113
114
114
115
### [PowerShell](#tab/in-powershell)
115
116
116
-
Paste the quoted string in `appDeploymentTemplateYaml` or `appDeploymentYaml` into a PowerShell, append `| ForEach-Object { [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_)) } | Select-String "secretName"`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
117
+
Paste the quoted string in`appDeploymentTemplateYaml` or `appDeploymentYaml` into a PowerShell (excluding the `| base64` portion), append `| ForEach-Object { [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_)) } | Select-String "secretName"`, and execute. This commandoutputs the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for`secretName` from the output.
117
118
118
119
---
119
120
120
-
These values will be used later in this article. Note that several other useful commands are listed in the outputs.
121
+
These values are used later in this article. Note that several other useful commands are listed in the outputs.
121
122
122
123
> [!NOTE]
123
124
> You may notice a similar output named **appDeploymentYaml**. The difference between output *appDeploymentTemplateYaml* and *appDeploymentYaml* is:
@@ -128,7 +129,23 @@ These values will be used later in this article. Note that several other useful
Now that the database and AKS cluster are created, we can proceed to preparing AKS to host your Open Liberty application.
132
149
133
150
## Configure and deploy the sample application
134
151
@@ -138,7 +155,7 @@ Follow the steps in this section to deploy the sample application on the Liberty
138
155
139
156
Clone the sample code for this guide. The sample is on [GitHub](https://github.com/Azure-Samples/open-liberty-on-aks).
140
157
141
-
There are a few samples in the repository. We'll use *java-app/*. Here's the file structure of the application.
158
+
There are a few samples in the repository. We use *java-app/*. Here's the file structure of the application.
142
159
143
160
#### [Bash](#tab/in-bash)
144
161
@@ -160,7 +177,7 @@ git checkout 20240109
160
177
161
178
---
162
179
163
-
If you see a message about being in "detached HEAD" state, this message is safe to ignore. It just means you have checked out a tag.
180
+
If you see a message about being in "detached HEAD" state, this message is safe to ignore. It just means you checked out a tag.
164
181
165
182
```
166
183
java-app
@@ -192,14 +209,14 @@ In directory *liberty/config*, the *server.xml* file is used to configure the DB
192
209
193
210
### Build the project
194
211
195
-
Now that you've gathered the necessary properties, you can build the application. The POM file forthe project reads many variables from the environment. As part of the Maven build, these variables are used to populate valuesin the YAML files located in*src/main/aks*. You can do something similar for your application outside Maven if you prefer.
212
+
Now that you gathered the necessary properties, you can build the application. The POM file for the project reads many variables from the environment. As part of the Maven build, these variables are used to populate values in the YAML files located in *src/main/aks*. You can do something similar for your application outside Maven if you prefer.
196
213
197
214
#### [Bash](#tab/in-bash)
198
215
199
216
200
217
```bash
201
218
cd $BASE_DIR/java-app
202
-
# The following variables will be used for deployment file generation into target.
219
+
# The following variables are used for deployment file generation into target.
You can now run and test the project locally before deploying to Azure. For convenience, we use the `liberty-maven-plugin`. To learn more about the `liberty-maven-plugin`, see [Building a web application with Maven](https://openliberty.io/guides/maven-intro.html). For your application, you can do something similar using any other mechanism, such as your local IDE. You can also consider using the `liberty:devc` option intended for development with containers. You can read more about `liberty:devc` in the [Liberty docs](https://openliberty.io/docs/latest/development-mode.html#_container_support_for_dev_mode).
240
257
241
-
1. Start the application using `liberty:run`. `liberty:run`will also use the environment variables defined in the previous step.
258
+
1. Start the application using `liberty:run`. `liberty:run` also uses the environment variables defined in the previous step.
242
259
243
260
#### [Bash](#tab/in-bash)
244
261
@@ -344,7 +361,7 @@ Use the following steps to deploy and test the application:
344
361
345
362
1. Connect to the AKS cluster.
346
363
347
-
Paste the value of **cmdToConnectToCluster** into a Bash shell and execute.
364
+
Paste the value of **cmdToConnectToCluster** into a shell and execute.
348
365
349
366
1. Apply the DB secret.
350
367
@@ -364,7 +381,7 @@ Use the following steps to deploy and test the application:
364
381
365
382
---
366
383
367
-
You'll see the output `secret/db-secret-sql created`.
384
+
You see the output `secret/db-secret-sql created`.
368
385
369
386
1. Apply the deployment file.
370
387
@@ -427,7 +444,7 @@ Use the following steps to deploy and test the application:
427
444
428
445
Copy the value of **ADDRESS** from the output, this is the frontend public IP address of the deployed Azure Application Gateway.
429
446
430
-
1. Go to `https://<ADDRESS>` to test the application. For your convenience, this shell commandwill create an environment variable whose value you can paste straight into the browser.
447
+
1. Go to `https://<ADDRESS>` to test the application. For your convenience, this shell commandcreates an environment variable whose value you can paste straight into the browser.
0 commit comments