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
Copy file name to clipboardExpand all lines: articles/aks/howto-deploy-java-liberty-app.md
+92-24Lines changed: 92 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,19 +45,27 @@ This article is intended to help you quickly get to deployment. Before going to
45
45
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.
46
46
47
47
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).
48
+
48
49
1. Select **Create**.
49
-
1. In the **Basics** pane, 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`. Select *East US* as **Region**. Select **Next** to **AKS** pane.
50
-
1. This pane allows you to select an 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 for the size and number of the virtual machines in the AKS node pool. Leave all other values at the defaults and select **Next** to **Load balancing** pane.
51
-
1. Next to **Connect to Azure Application Gateway?** select **Yes**. This section lets you customize the following deployment options.
52
-
1. You can customize the virtual network and subnet into which the deployment will place the resources. Leave these values at their defaults.
53
-
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).
54
-
1. You can enable cookie based affinity, also known as sticky sessions. We want sticky sessions enabled for this article, so ensure this option is selected.
55
-

56
-
1. Select **Next** to **Operator and application** pane. This quickstart uses all defaults in this pane. However, it lets you customize the following deployment options.
57
-
1. You can deploy WebSphere Liberty Operator by selecting **Yes** for option **IBM supported?**. Leaving the default **No** deploys Open Liberty Operator.
58
-
1. You can deploy an application for your selected Operator by selecting **Yes** for option **Deploy an application?**. Leaving the default **No** doesn't deploy any application.
59
-
1. Select **Review + create** to validate your selected options.
60
-
1. When you see the message **Validation Passed**, select **Create**. The deployment may take up to 20 minutes.
50
+

51
+
52
+
1. In the **Basics** pane
53
+
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`.
54
+
1. Select *East US* as **Region**.
55
+
56
+
1. Select **Next**, enter the **AKS** pane. This pane allows you to select an 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 for the size and number of the virtual machines in the AKS node pool. Leave all other values at the defaults.
57
+
58
+
1. Select **Next**, enter the **Load Balancing** pane. Next to **Connect to Azure Application Gateway?** select **Yes**, then further configuration will be required.
59
+
1. You can customize the **virtual network** and **subnet** into which the deployment will place the resources. Leave these values at their defaults.
60
+
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).
61
+
1. You can enable **cookie based affinity**, also known as sticky sessions. We want sticky sessions enabled for this article, so ensure this option is selected.
62
+

63
+
64
+
1. Select **Next**, enter the **Operator and application** pane. Leave these values at their defaults.
65
+
1.**IBM Supported?** if **Yes**, you select to deploy IBM WebSphere Liberty Operator; if **No**, you select to deploy Open Liberty Operator.
66
+
1.**Deploy an application?** if **Yes**, you may select to deploy your own application image which need to be public and accessible without credential; or select to deploy the Open Liberty sample image.
67
+
68
+
1. Select **Review + create** to validate your selected options. In the ***Review + create** pane, when you see **Create** light up after validation pass, select **Create**. The deployment may take up to 20 minutes.
61
69
62
70
## Capture selected information from the deployment
63
71
@@ -75,9 +83,15 @@ If you navigated away from the **Deployment is in progress** page, the following
75
83
1. Using the same copy technique as with the preceding values, save aside the values for the following outputs:
76
84
77
85
*`cmdToConnectToCluster`
78
-
*`appDeploymentTemplateYaml`
86
+
*`appDeploymentTemplateYaml` if you select **No** to **Deploy an application?** when deploying the Marketplace offer; or `appDeploymentYaml` if you select **yes** to **Deploy an application?**.
87
+
88
+
### [Bash](#tab/in-bash)
89
+
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.
90
+
91
+
### [PowerShell](#tab/in-powershell)
92
+
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.
79
93
80
-
1. Paste the value of `appDeploymentTemplateYaml` 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.
94
+
---
81
95
82
96
These values will be used later in this article. Note that several other useful commands are listed in the outputs.
83
97
@@ -111,7 +125,7 @@ Clone the sample code for this guide. The sample is on [GitHub](https://github.c
111
125
112
126
There are a few samples in the repository. We'll use *java-app/*. Here's the file structure of the application.
@@ -151,6 +165,7 @@ In directory *liberty/config*, the *server.xml* file is used to configure the DB
151
165
152
166
Now that you've 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.
@@ -274,21 +328,35 @@ The following steps deploy and test the application.
274
328
275
329
1. Go to `https://<ADDRESS>` to test the application. For your convenience, this shell command will create an environment variable whose value you can paste straight into the browser.
If the web page doesn't render correctly or returns a `502 Bad Gateway` error, that's because the app is still starting in the background. Wait for a few minutes and then try again.
283
344
284
345
## Clean up resources
285
346
286
347
To avoid Azure charges, you should clean up unnecessary resources. When the cluster is no longer needed, use the [az group delete](/cli/azure/group#az-group-delete) command to remove the resource group, container service, container registry, and all related resources.
287
348
288
-
```azurecli-interactive
349
+
### [Bash](#tab/in-bash)
350
+
```bash
289
351
az group delete --name $RESOURCE_GROUP_NAME --yes --no-wait
290
352
az group delete --name <db-resource-group> --yes --no-wait
291
353
```
354
+
### [PowerShell](#tab/in-powershell)
355
+
```powershell
356
+
az group delete --name $Env:RESOURCE_GROUP_NAME --yes --no-wait
357
+
az group delete --name <db-resource-group> --yes --no-wait
0 commit comments