Skip to content

Commit 14ce38e

Browse files
committed
Merge branch 'edburns-msft-em-6234-reza-fixes' into 'main'
Fixes from m_reza_rahman See merge request weblogic-cloud/weblogic-kubernetes-operator!4854 (cherry picked from commit 591f2b1) 1678873 Bug fixes, simplifications, and updates c7349d9 improve scripts e97b9d0 update content of domain on PV sample automation. 951ed56 clarify editing create-domain-on-aks-inputs.sh is optional eb5599f Merge remote-tracking branch 'oracle/main' into edburns-msft-em-6234-reza-fixes c805927 improve script comments 49d2a7a increase the max wait time
1 parent a713b0a commit 14ce38e

File tree

17 files changed

+480
-341
lines changed

17 files changed

+480
-341
lines changed

documentation/site/content/managing-domains/aks/_index.md

Lines changed: 20 additions & 18 deletions
Large diffs are not rendered by default.

documentation/site/content/samples/azure-kubernetes-service/_index.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ description: "Sample for using the operator to set up a WLS cluster on the Azure
1111

1212
This sample demonstrates how to use the [WebLogic Kubernetes Operator]({{< relref "/_index.md" >}}) (hereafter "the operator") to set up a WebLogic Server (WLS) cluster on the Azure Kubernetes Service (AKS). After going through the steps, your WLS domain runs on an AKS cluster. You have several options for managing the cluster, depending on which [domain home source type]({{< relref "/managing-domains/choosing-a-model/_index.md" >}}) you choose. With Domain on PV, you can manage your WLS domain by accessing the WebLogic Server Administration Console or WLST. With Model in Image, you use the operator to perform WLS administrative operations.
1313

14-
**NOTE**: For an alternative approach to this sample,
15-
see the [Oracle WebLogic Server on AKS from the Azure Marketplace]({{<relref "/managing-domains/aks/_index.md">}})
16-
offering which automates the provisioning of
17-
AKS cluster, AKS resources, the Azure Container Registry (ACR),
18-
WebLogic Kubernetes Operator, and WebLogic Server images.
14+
{{% notice note %}}
15+
For an alternative approach to this sample, see the [Oracle WebLogic Server on AKS Azure Marketplace offering]({{<relref "/managing-domains/aks/_index.md">}}), which automates the provisioning of
16+
the AKS cluster, AKS resources, Azure Container Registry (ACR), load-balancer, WebLogic Kubernetes Operator, and WebLogic Server images.
17+
{{% /notice %}}
1918

2019
#### Azure Kubernetes Service cluster
2120

documentation/site/content/samples/azure-kubernetes-service/domain-on-pv.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ weight: 2
55
description: "Sample for creating a WebLogic domain home on an existing PV or PVC on the Azure Kubernetes Service."
66
---
77

8-
This sample demonstrates how to use the [WebLogic Kubernetes Operator](https://oracle.github.io/weblogic-kubernetes-operator) (hereafter "the operator") to set up a WebLogic Server (WLS) cluster on the Azure Kubernetes Service (AKS) using the domain on PV approach. After going through the steps, your WLS domain runs on an AKS cluster instance and you can manage your WLS domain by accessing the WebLogic Server Administration Console.
8+
This sample demonstrates how to use the [WebLogic Kubernetes Operator](https://oracle.github.io/weblogic-kubernetes-operator) (hereafter "the operator") to set up a WebLogic Server (WLS) cluster on the Azure Kubernetes Service (AKS) using the domain on PV approach. After going through the steps, your WLS domain runs on an AKS cluster and you can manage your WLS domain by accessing the WebLogic Server Administration Console.
99

1010
#### Contents
1111

@@ -32,6 +32,8 @@ This sample demonstrates how to use the [WebLogic Kubernetes Operator](https://o
3232

3333
##### Prepare parameters
3434

35+
Set required parameters by running the following commands.
36+
3537
```shell
3638
# Change these parameters as needed for your own environment
3739
export ORACLE_SSO_EMAIL=<replace with your oracle account email>
@@ -59,11 +61,11 @@ export ACR_NAME="${NAME_PREFIX}acr${TIMESTAMP}"
5961

6062
{{< readfile file="/samples/azure-kubernetes-service/includes/sign-in-azure.txt" >}}
6163

64+
{{< readfile file="/samples/azure-kubernetes-service/includes/download-samples-zip.txt" >}}
65+
6266
{{% notice info %}} The following sections of the sample instructions will guide you, step-by-step, through the process of setting up a WebLogic cluster on AKS - remaining as close as possible to a native Kubernetes experience. This lets you understand and customize each step. If you wish to have a more automated experience that abstracts some lower level details, you can skip to the [Automation](#automation) section.
6367
{{% /notice %}}
6468

65-
{{< readfile file="/samples/azure-kubernetes-service/includes/download-samples-zip.txt" >}}
66-
6769
{{< readfile file="/samples/azure-kubernetes-service/includes/create-resource-group.txt" >}}
6870

6971
{{< readfile file="/samples/azure-kubernetes-service/includes/create-aks-cluster-body-02.txt" >}}
@@ -121,7 +123,7 @@ See [Understanding your first archive]({{< relref "/samples/domains/domain-home-
121123

122124
##### Staging a ZIP file of the archive
123125

124-
Delete existing archive.zip in case we have an old leftover version.
126+
Delete any possible existing archive.zip in case we have an old leftover version.
125127

126128
```shell
127129
$ rm -f ${WDT_MODEL_FILES_PATH}/WLS-v1/archive.zip
@@ -215,27 +217,32 @@ Now that you have created the AKS cluster, installed the operator, and verified
215217

216218
##### Create secrets
217219

218-
You will use the `$BASE_DIR/sample-scripts/create-weblogic-domain-credentials/create-weblogic-credentials.sh` script to create the domain WebLogic administrator credentials as a Kubernetes secret. Please run:
220+
You will use the `$BASE_DIR/sample-scripts/create-weblogic-domain-credentials/create-weblogic-credentials.sh` script to create the domain WebLogic administrator credentials as a Kubernetes secret. Please run the following commands:
219221

220222
```
221223
cd $BASE_DIR/sample-scripts/create-weblogic-domain-credentials
222224
```
223225
```shell
224226
$ ./create-weblogic-credentials.sh -u ${WEBLOGIC_USERNAME} -p ${WEBLOGIC_PASSWORD} -d domain1
225227
```
228+
229+
The output will show something similar to the following:
230+
226231
```
227232
secret/domain1-weblogic-credentials created
228233
secret/domain1-weblogic-credentials labeled
229234
The secret domain1-weblogic-credentials has been successfully created in the default namespace.
230235
```
231236

232-
233-
You will use the `kubernetes/samples/scripts/create-kubernetes-secrets/create-docker-credentials-secret.sh` script to create the Docker credentials as a Kubernetes secret. Please run:
237+
You will use the `kubernetes/samples/scripts/create-kubernetes-secrets/create-docker-credentials-secret.sh` script to create the Docker credentials as a Kubernetes secret. Please run the following commands:
234238

235239
``` shell
236240
$ cd $BASE_DIR/sample-scripts/create-kubernetes-secrets
237241
$ ./create-docker-credentials-secret.sh -s ${SECRET_NAME_DOCKER} -e ${ORACLE_SSO_EMAIL} -p ${ORACLE_SSO_PASSWORD} -u ${ORACLE_SSO_EMAIL}
238242
```
243+
244+
The output will show something similar to the following:
245+
239246
```
240247
secret/wlsregcred created
241248
The secret wlsregcred has been successfully created in the default namespace.
@@ -246,6 +253,9 @@ Verify secrets with the following command:
246253
```shell
247254
$ kubectl get secret
248255
```
256+
257+
The output will show something similar to the following:
258+
249259
```
250260
NAME TYPE DATA AGE
251261
domain1-weblogic-credentials Opaque 2 2m32s
@@ -268,7 +278,7 @@ kubectl label namespace default weblogic-operator=enabled
268278
##### Create WebLogic Domain
269279
Now, you deploy a `sample-domain1` domain resource and an associated `sample-domain1-cluster-1` cluster resource using a single YAML resource file which defines both resources. The domain resource and cluster resource tells the operator how to deploy a WebLogic domain. They do not replace the traditional WebLogic configuration files, but instead cooperate with those files to describe the Kubernetes artifacts of the corresponding domain.
270280

271-
- Run the following command to generate resource files.
281+
- Run the following commands to generate resource files.
272282

273283
Export `Domain_Creation_Image_tag`, which will be referred in `create-domain-on-aks-generate-yaml.sh`.
274284

@@ -296,12 +306,19 @@ The domain resource references the cluster resource, a WebLogic Server installat
296306
```shell
297307
$ kubectl apply -f admin-lb.yaml
298308
```
309+
310+
The output will show something similar to the following:
311+
299312
```
300313
service/domain1-admin-server-external-lb created
301314
```
315+
302316
```shell
303317
$ kubectl apply -f cluster-lb.yaml
304318
```
319+
320+
The output will show something similar to the following:
321+
305322
```
306323
service/domain1-cluster-1-external-lb created
307324
```
@@ -363,7 +380,7 @@ The domain resource references the cluster resource, a WebLogic Server installat
363380
364381
```
365382

366-
In the example, the URL to access the Administration Server is: `http://4.157.147.131/console`.
383+
In the example, the URL to access the Administration Server is: `http://4.157.147.131:7001/console`.
367384
The user name and password that you enter for the Administration Console must match the ones you specified for the `domain1-weblogic-credentials` secret in the [Create secrets](#create-secrets) step.
368385

369386
If the WLS Administration Console is still not available, use `kubectl get events --sort-by='.metadata.creationTimestamp' ` to troubleshoot.
@@ -372,25 +389,20 @@ The domain resource references the cluster resource, a WebLogic Server installat
372389
$ kubectl get events --sort-by='.metadata.creationTimestamp'
373390
```
374391

375-
To access the sample application on WLS, you may skip to the section [Access sample application](#access-sample-application). The next section includes a script that automates all of the preceding steps.
392+
To access the sample application on WLS, skip to the section [Access sample application](#access-sample-application). The next section includes a script that automates all of the preceding steps.
376393

377394
#### Automation
378395

379-
If you want to automate the above steps of creating AKS cluster and WLS domain, you can use the script `${BASE_DIR}/sample-scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks.sh`.
396+
If you want to automate the above steps of creating the AKS cluster and WLS domain, you can use the script `${BASE_DIR}/sample-scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks.sh`.
380397

381398
The sample script will create a WLS domain home on the AKS cluster, including:
382399
- Creating a new Azure resource group, with a new Azure Storage Account and Azure File Share to allow WebLogic to persist its configuration and data separately from the Kubernetes pods that run WLS workloads.
383400
- Creating WLS domain home.
384401
- Generating the domain resource YAML files, which can be used to restart the Kubernetes artifacts of the corresponding domain.
385402

386-
For input values, you can edit `${BASE_DIR}/sample-scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks-inputs.sh` directly. The following values must be specified:
403+
To customize the WLS domain, you can optionally edit `${BASE_DIR}/sample-scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks-inputs.sh`.
387404

388-
| Name in YAML file | Example value | Notes |
389-
|-------------------|---------------------|------------------------------------------------------------------------------------------------|
390-
| `dockerEmail` | `yourDockerEmail` | Oracle Single Sign-On (SSO) account email, used to pull the WebLogic Server Docker image. |
391-
| `dockerPassword` | `yourDockerPassword` | Password for Oracle SSO account, used to pull the WebLogic Server Docker image, in clear text. |
392-
| `weblogicUserName` | `weblogic` | Uername for WebLogic user account. |
393-
| `weblogicAccountPassword` | `Secret123456` | Password for WebLogic user account. |
405+
You can now run the script.
394406

395407
```shell
396408
$ cd ${BASE_DIR}/sample-scripts/create-weblogic-domain-on-azure-kubernetes-service
@@ -400,7 +412,7 @@ $ cd ${BASE_DIR}/sample-scripts/create-weblogic-domain-on-azure-kubernetes-servi
400412
$ ./create-domain-on-aks.sh
401413
```
402414

403-
The script will print the Administration Server address after a successful deployment.
415+
The script will take some time to run. The script will print the Administration Server address after a successful deployment.
404416
To interact with the cluster using `kubectl`, use `az aks get-credentials` as shown in the script output.
405417

406418
{{% notice info %}} You now have created an AKS cluster with Azure Files NFS share to contain the WLS domain configuration files. Using those artifacts, you have used the operator to create a WLS domain.
@@ -421,12 +433,11 @@ Access the sample application using the cluster load balancer IP address.
421433
$ CLUSTER_IP=$(kubectl get svc domain1-cluster-1-lb -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
422434
```
423435

424-
425436
```shell
426437
$ curl http://${CLUSTER_IP}:8001/myapp_war/index.jsp
427438
```
428439

429-
The test application will list the server host and server IP on the output, like the following:
440+
The test application will list the server host on the output, like the following:
430441

431442
```html
432443
<html><body><pre>
@@ -478,7 +489,7 @@ wlsstorage1612795811.file.core.windows.net:/wlsstorage1612795811/wls-weblogic-16
478489

479490
{{< readfile file="/samples/azure-kubernetes-service/includes/clean-up-resources-body-01.txt" >}}
480491

481-
If you created the AKS cluster step by step, run the following commands to clean up resources.
492+
If you created the AKS cluster step by step, run the following command to clean up resources.
482493

483494
{{< readfile file="/samples/azure-kubernetes-service/includes/clean-up-resources-body-02.txt" >}}
484495

documentation/site/content/samples/azure-kubernetes-service/includes/aks-connect-acr.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Finally, connect AKS to the ACR. For more details on connecting ACR to an existing AKS, see [Configure ACR integration for existing AKS clusters](https://learn.microsoft.com/en-us/azure/aks/cluster-container-registry-integration?tabs=azure-cli#configure-acr-integration-for-an-existing-aks-cluster).
1+
Finally, connect the AKS cluster to the ACR. For more details on connecting ACR to an existing AKS, see [Configure ACR integration for existing AKS clusters](https://learn.microsoft.com/en-us/azure/aks/cluster-container-registry-integration?tabs=azure-cli#configure-acr-integration-for-an-existing-aks-cluster).
22

33
```shell
44
$ export ACR_ID=$(az acr show -n $ACR_NAME --resource-group $AKS_PERS_RESOURCE_GROUP --query "id" -o tsv)

documentation/site/content/samples/azure-kubernetes-service/includes/clean-up-resources-body-01.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The output from the `create-domain-on-aks.sh` script includes a statement about the Azure resources created by the script. To delete the cluster and free all related resources, simply delete the resource groups. The output will list the resource groups, such as.
1+
If you used the automation script, the output from the `create-domain-on-aks.sh` script includes a statement about the Azure resources created by the script. To delete the cluster and free all related resources, simply delete the resource groups. The output will list the resource groups, such as:
22

33
```shell
44
The following Azure Resouces have been created:

documentation/site/content/samples/azure-kubernetes-service/includes/create-acr.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Closely examine the JSON output from this command. Save the value of the `loginS
1212
"loginServer": "contosoresourcegroup1610068510.azurecr.io",
1313
```
1414

15-
Use this value to sign in to the ACR instance. Note that because you are signing in with the `az` cli, you do not need a password because your identity is already conveyed by having done `az login` previously.
15+
Use this value to sign in to the ACR instance. Note that because you are signing in with the `az` CLI, you do not need a password because your identity is already conveyed by having done `az login` previously.
1616

1717
```shell
1818
$ export LOGIN_SERVER=$(az acr show -n $ACR_NAME --resource-group $AKS_PERS_RESOURCE_GROUP --query "loginServer" -o tsv)

documentation/site/content/samples/azure-kubernetes-service/includes/create-aks-cluster-body-01.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
##### Oracle Container Registry
22

3-
You will need an Oracle account. The following steps will direct you to accept the license agreement for WebLogic Server. Make note of your Oracle Account password and email. This sample pertains to 12.2.1.4, but other versions may work as well.
3+
The following steps will direct you to accept the license agreement for WebLogic Server. Make note of your Oracle Account password and email. This sample pertains to 12.2.1.4, but other versions may work as well.
44

55
- In a web browser, navigate to https://container-registry.oracle.com and log in using the Oracle Single Sign-On authentication service. If you do not already have SSO credentials, at the top of the page, click the **Sign In** link to create them.
66
- The Oracle Container Registry provides a WebLogic 12.2.1.4 General Availability (GA) installation image that is used in this sample.
7+
- In the Oracle Container Registry, navigate to **Middleware**, then **weblogic**.
8+
- On the left, choose a language and accept the license agreement. You will then see a message such as: "You last accepted the Oracle Standard Terms and Restrictions on 08/10/2020 at 06:12 AM Coordinated Universal Time (UTC)."
79
- **NOTE**: General Availability (GA) images are suitable for demonstration and development purposes _only_ where the environments are not available from the public Internet; they are **not
810
acceptable for production use**. In production, you should always use CPU (patched) images
911
from the OCR
1012
or create your images using the [WebLogic Image Tool](https://oracle.github.io/weblogic-image-tool/userguide/tools/create-image/)
1113
(WIT) with the `--recommendedPatches` option. For more guidance,
1214
see [Apply the Latest Patches and Updates](https://www.oracle.com/pls/topic/lookup?ctx=en/middleware/standalone/weblogic-server/14.1.1.0&id=LOCKD-GUID-2DA84185-46BA-4D7A-80D2-9D577A4E8DE2)
1315
in _Securing a Production Environment for Oracle WebLogic Server_.
14-
- Ensure that Docker is running. Find and then pull the WebLogic 12.2.1.4 installation image:
16+
- Ensure that Docker is running. Find and pull the WebLogic 12.2.1.4 installation image:
1517
```shell
1618
$ docker login container-registry.oracle.com -u ${ORACLE_SSO_EMAIL} -p ${ORACLE_SSO_PASSWORD}
1719
$ docker pull container-registry.oracle.com/middleware/weblogic:12.2.1.4

documentation/site/content/samples/azure-kubernetes-service/includes/create-aks-cluster-body-02.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
This sample doesn't enable application routing. If you want to enable application routing, follow [Managed nginx Ingress with the application routing add-on in AKS](https://learn.microsoft.com/azure/aks/app-routing?tabs=default%2Cdeploy-app-default).
55

6-
Run the following commands to create the AKS cluster instance.
6+
Run the following command to create the AKS cluster.
77

88
```shell
99
$ az aks create \

0 commit comments

Comments
 (0)