Skip to content

Commit 53e1c2c

Browse files
Merge pull request #217967 from KarlErickson/karler-majguo
edits to "revise the guide to work with agic"
2 parents 3e59666 + 6656297 commit 53e1c2c

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

articles/aks/howto-deploy-java-liberty-app.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Deploy a Java application with Open Liberty/WebSphere Liberty on an Azure Kubernetes Service (AKS) cluster
33
recommendations: false
44
description: Deploy a Java application with Open Liberty/WebSphere Liberty on an Azure Kubernetes Service (AKS) cluster
5-
author: zhengchang907
5+
author: KarlErickson
66
ms.author: zhengchang
77
ms.service: container-service
88
ms.topic: how-to
@@ -66,12 +66,14 @@ If you navigated away from the **Deployment is in progress** page, the following
6666
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.
6767
1. Navigate again to the resource group into which you deployed the resources.
6868
1. In the **Settings** section, select **Deployments**.
69-
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**.
69+
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`.
7070
1. In the left pane, select **Outputs**.
7171
1. Using the same copy technique as with the preceding values, save aside the values for the following outputs:
7272

73-
* **cmdToConnectToCluster**
74-
73+
* `cmdToConnectToCluster`
74+
* `appDeploymentTemplateYaml`
75+
76+
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.
7577

7678
These values will be used later in this article. Note that several other useful commands are listed in the outputs.
7779

@@ -109,7 +111,7 @@ java-app
109111
├─ src/main/
110112
│ ├─ aks/
111113
│ │ ├─ db-secret.yaml
112-
│ │ ├─ openlibertyapplication.yaml
114+
│ │ ├─ openlibertyapplication-agic.yaml
113115
│ ├─ docker/
114116
│ │ ├─ Dockerfile
115117
│ │ ├─ Dockerfile-local
@@ -125,7 +127,7 @@ java-app
125127

126128
The directories *java*, *resources*, and *webapp* contain the source code of the sample application. The code declares and uses a data source named `jdbc/JavaEECafeDB`.
127129

128-
In the *aks* directory, we placed two deployment files. *db-secret.xml* is used to create [Kubernetes Secrets](https://kubernetes.io/docs/concepts/configuration/secret/) with DB connection credentials. The file *openlibertyapplication.yaml* is used to deploy the application image.
130+
In the *aks* directory, we placed three deployment files. *db-secret.xml* is used to create [Kubernetes Secrets](https://kubernetes.io/docs/concepts/configuration/secret/) with DB connection credentials. The file *openlibertyapplication-agic.yaml* is used to deploy the application image.
129131

130132
In directory *liberty/config*, the *server.xml* FILE is used to configure the DB connection for the Open Liberty and WebSphere Liberty cluster.
131133

@@ -145,6 +147,7 @@ export DB_SERVER_NAME=<Server name>.database.windows.net
145147
export DB_NAME=<Database name>
146148
export DB_USER=<Server admin login>@<Server name>
147149
export DB_PASSWORD=<Server admin password>
150+
export INGRESS_TLS_SECRET=<Ingress TLS secret name>
148151

149152
mvn clean install
150153
```
@@ -161,7 +164,7 @@ Use your local ide, or `liberty:run` command to run and test the project locally
161164
cd <path-to-your-repo>/java-app
162165
mvn liberty:run
163166
```
164-
167+
165168
1. Verify the application works as expected. You should see a message similar to `[INFO] [AUDIT] CWWKZ0003I: The application javaee-cafe updated in 1.930 seconds.` in the command output if successful. Go to `http://localhost:9080/` in your browser and verify the application is accessible and all functions are working.
166169

167170
1. Press `Ctrl+C` to stop `liberty:run` mode.
@@ -173,10 +176,10 @@ After successfully running the app in the Liberty Docker container, you can run
173176
```bash
174177
cd <path-to-your-repo>/java-app/target
175178

176-
# If you are running with Open Liberty
179+
# If you're running with Open Liberty
177180
docker build -t javaee-cafe:v1 --pull --file=Dockerfile .
178181

179-
# If you are running with WebSphere Liberty
182+
# If you're running with WebSphere Liberty
180183
docker build -t javaee-cafe:v1 --pull --file=Dockerfile-wlp .
181184
```
182185

@@ -196,7 +199,7 @@ The following steps deploy and test the application.
196199

197200
1. Connect to the AKS cluster.
198201

199-
Paste the value of **cmdToConnectToCluster** into a bash shell.
202+
Paste the value of **cmdToConnectToCluster** into a Bash shell and execute.
200203

201204
1. Apply the DB secret.
202205

@@ -210,7 +213,7 @@ The following steps deploy and test the application.
210213
1. Apply the deployment file.
211214

212215
```bash
213-
kubectl apply -f openlibertyapplication.yaml
216+
kubectl apply -f openlibertyapplication-agic.yaml
214217
```
215218

216219
1. Wait for the pods to be restarted.
@@ -224,22 +227,23 @@ The following steps deploy and test the application.
224227
You should see output similar to the following to indicate that all the pods are running.
225228

226229
```bash
227-
NAME READY STATUS RESTARTS AGE
228-
javaee-cafe-cluster-67cdc95bc-2j2gr 1/1 Running 0 29s
229-
javaee-cafe-cluster-67cdc95bc-fgtt8 1/1 Running 0 29s
230-
javaee-cafe-cluster-67cdc95bc-h47qm 1/1 Running 0 29s
230+
NAME READY STATUS RESTARTS AGE
231+
javaee-cafe-cluster-agic-67cdc95bc-2j2gr 1/1 Running 0 29s
232+
javaee-cafe-cluster-agic-67cdc95bc-fgtt8 1/1 Running 0 29s
233+
javaee-cafe-cluster-agic-67cdc95bc-h47qm 1/1 Running 0 29s
231234
```
232235

233236
1. Verify the results.
234237

235-
1. Get endpoint of the deployed service
238+
1. Get **ADDRESS** of the Ingress resource deployed with the application
236239

237240
```bash
238-
kubectl get service
241+
kubectl get ingress
239242
```
240243

241-
1. Go to `http://EXTERNAL-IP` to test the application.
242-
244+
Copy the value of **ADDRESS** from the output, this is the frontend public IP address of the deployed Azure Application Gateway.
245+
246+
1. Go to `https://<ADDRESS>` to test the application.
243247

244248
## Clean up resources
245249

0 commit comments

Comments
 (0)