Skip to content

Commit 8613f9d

Browse files
committed
Merge branch 'upgrade-wko-in-aks-sample' into 'main'
Update aks samples See merge request weblogic-cloud/weblogic-kubernetes-operator!4640 (cherry picked from commit a2320a0) 108e3f4 update aks samples. b75009e update download-wls-tools.txt e225387 fix app path 262b221 fix scripts e8386a4 access the built in sample application. 275aca5 update index.jsp content. e39b381 Merge branch 'oracle:main' into main e5744b7 On branch upgrade-wko-in-aks-sample Ready for review from Rosemary.
1 parent 1d6074b commit 8613f9d

File tree

12 files changed

+329
-434
lines changed

12 files changed

+329
-434
lines changed

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

Lines changed: 149 additions & 159 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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).
2+
3+
```shell
4+
$ export ACR_ID=$(az acr show -n $ACR_NAME --resource-group $AKS_PERS_RESOURCE_GROUP --query "id" -o tsv)
5+
$ az aks update --name $AKS_CLUSTER_NAME --resource-group $AKS_PERS_RESOURCE_GROUP --attach-acr $ACR_ID
6+
```
7+
8+
Successful output will be a JSON object with the entry `"type": "Microsoft.ContainerService/ManagedClusters"`.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
AKS can pull images from any container registry, but the easiest integration is to use Azure Container Registry (ACR). In addition to simplicity, using ACR simplifies high availability and disaster recovery with features such as geo-replication. For more information, see [Geo-replication in Azure Container Registry](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-geo-replication). In this section, we will create a new Azure Container Registry, connect it to our pre-existing AKS cluster and push the image built in the preceding section to it. For complete details, see [Azure Container Registry documentation](https://learn.microsoft.com/en-us/azure/container-registry/).
2+
3+
Let's create an instance of ACR in the same resource group we used for AKS. We will use the environment variables used during the steps above. For simplicity, we use the resource group name as the name of the ACR instance.
4+
5+
```shell
6+
$ az acr create --resource-group $AKS_PERS_RESOURCE_GROUP --name $ACR_NAME --sku Basic --admin-enabled true
7+
```
8+
9+
Closely examine the JSON output from this command. Save the value of the `loginServer` property aside. It will look something like the following.
10+
11+
```json
12+
"loginServer": "contosoresourcegroup1610068510.azurecr.io",
13+
```
14+
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.
16+
17+
```shell
18+
$ export LOGIN_SERVER=$(az acr show -n $ACR_NAME --resource-group $AKS_PERS_RESOURCE_GROUP --query "loginServer" -o tsv)
19+
```
20+
```shell
21+
$ az acr login --name $LOGIN_SERVER
22+
```
23+
24+
Successful output will include `Login Succeeded`.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ You will dynamically create and use a persistent volume with Azure Files NFS sha
3434
Successful output will be a JSON object with the entry `"type": "Microsoft.Storage/storageAccounts"`.
3535

3636
2. Create an NFS share.
37-
{{% notice note %}} We strongly recommend NFS instead of SMB. NFS evolved from the UNIX operating system, and other variants such as GNU/Linux. For this reason, when using NFS with container technologies such as Docker, it is less likely to have problems for concurrent reads and file locking.
3837

39-
Please be sure to enable NFS v4.1. Versions lower than v4.1 will have problems.
38+
We strongly recommend NFS instead of SMB. NFS evolved from the UNIX operating system, and other variants such as GNU/Linux. For this reason, when using NFS with container technologies such as Docker, it is less likely to have problems for concurrent reads and file locking.
4039

41-
{{% /notice %}}
40+
Please be sure to enable NFS v4.1. Versions lower than v4.1 will have problems.
4241

4342
To create the file share, you must use `NoRootSquash` to allow the operator to change the ownership of the directory in the NFS share.
4443

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
##### Download the WebLogic Kubernetes Operator sample.
22

3-
Download the WebLogic Kubernetes Operator sample ZIP file. We will use several scripts in this zip file to create a WebLogic domain. This sample was tested with v4.1.7, but should work with the latest release.
3+
Download the WebLogic Kubernetes Operator sample ZIP file. We will use several scripts in this zip file to create a WebLogic domain. This sample was tested with v4.1.8, but should work with the latest release.
44

55
```shell
66
$ cd $BASE_DIR
77
$ mkdir sample-scripts
8-
$ curl -m 120 -fL https://github.com/oracle/weblogic-kubernetes-operator/releases/download/v4.1.7/sample-scripts.zip \
8+
$ curl -m 120 -fL https://github.com/oracle/weblogic-kubernetes-operator/releases/download/v4.1.8/sample-scripts.zip \
99
-o ${BASE_DIR}/sample-scripts/sample-scripts.zip
1010
$ unzip ${BASE_DIR}/sample-scripts/sample-scripts.zip -d ${BASE_DIR}/sample-scripts
1111
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
- Download the latest WebLogic Deploying Tooling (WDT) and WebLogic Image Tool (WIT) installer ZIP files to your `${WDT_MODEL_FILES_PATH}` directory. Both WDT and WIT are required to create your Model in Image images.
2+
3+
```shell
4+
$ curl -m 120 -fL https://github.com/oracle/weblogic-deploy-tooling/releases/latest/download/weblogic-deploy.zip \
5+
-o ${WDT_MODEL_FILES_PATH}/weblogic-deploy.zip
6+
```
7+
```shell
8+
$ curl -m 120 -fL https://github.com/oracle/weblogic-image-tool/releases/latest/download/imagetool.zip \
9+
-o ${WDT_MODEL_FILES_PATH}/imagetool.zip
10+
```
11+
12+
- Set up the WebLogic Image Tool, run the following commands:
13+
```shell
14+
$ unzip ${WDT_MODEL_FILES_PATH}/imagetool.zip -d ${WDT_MODEL_FILES_PATH}
15+
```
16+
17+
```
18+
$ ${WDT_MODEL_FILES_PATH}/imagetool/bin/imagetool.sh cache deleteEntry --key wdt_latest
19+
```
20+
21+
```shell
22+
$ ${WDT_MODEL_FILES_PATH}/imagetool/bin/imagetool.sh cache addInstaller \
23+
--type wdt \
24+
--version latest \
25+
--path ${WDT_MODEL_FILES_PATH}/weblogic-deploy.zip
26+
```
27+
28+
These steps will install WIT to the `${WDT_MODEL_FILES_PATH}/imagetool` directory, plus put a `wdt_latest` entry in the tool’s cache which points to the WDT ZIP file installer. You will use WIT later in the sample for creating model images.

documentation/site/content/samples/azure-kubernetes-service/includes/prerequisites-01.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ This sample assumes the following prerequisite environment.
1010
* Operating System: GNU/Linux, macOS or [WSL2 for Windows 10](https://docs.microsoft.com/windows/wsl/install-win10).
1111
* Note: the Docker image creation steps will not work on a Mac with Apple Silicon.
1212
* [Git](https://git-scm.com/downloads); use `git --version` to test if `git` works. This document was tested with version 2.25.1.
13-
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.48.1.
13+
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.58.0.
1414
* [Docker for Desktop](https://www.docker.com/products/docker-desktop). This document was tested with `Docker version 20.10.7`
1515
* [kubectl](https://kubernetes-io-vnext-staging.netlify.com/docs/tasks/tools/install-kubectl/); use `kubectl version` to test if `kubectl` works. This document was tested with version v1.21.2.
1616
* [Helm](https://helm.sh/docs/intro/install/), version 3.1 and later; use `helm version` to check the `helm` version. This document was tested with version v3.6.2.
1717
* A Java JDK, Version 8 or 11. Azure recommends [Microsoft Build of OpenJDK](https://docs.microsoft.com/java/openjdk/download). Ensure that your `JAVA_HOME` environment variable is set correctly in the shells in which you run the commands.
18-
* A `domain creation image` tagged as `wdt-domain-image:WLS-v1` in your local Docker server's image cache. You can create it by following the [Build the domain creation image]({{< relref "/samples/domains/domain-home-on-pv/build-domain-creation-image#build-the-domain-creation-image" >}}) step.
18+
* Ensure that you have the zip/unzip utility installed; use `zip/unzip -v` to test if `zip/unzip` works.

documentation/site/content/samples/azure-kubernetes-service/includes/prerequisites-02.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This sample assumes the following prerequisite environment.
77
* If your identity has very limited role assignments, ensure you have [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) role and [User Access Administrator](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator) role in the resource group that runs the AKS cluster. This requires asking a privileged user to assign the roles before creating resources in the resource group.
88
* Operating System: GNU/Linux, macOS (Intel only, Apple Silicon not supported) [WSL2 for Windows 10](https://docs.microsoft.com/windows/wsl/install-win10).
99
* [Git](https://git-scm.com/downloads); use `git --version` to test if `git` works. This document was tested with version 2.25.1.
10-
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.48.1.
10+
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.58.0.
1111
* [Docker for Desktop](https://www.docker.com/products/docker-desktop). This document was tested with `Docker version 20.10.7`
1212
* [kubectl](https://kubernetes-io-vnext-staging.netlify.com/docs/tasks/tools/install-kubectl/); use `kubectl version` to test if `kubectl` works. This document was tested with version v1.21.2.
1313
* [Helm](https://helm.sh/docs/intro/install/), version 3.1 and later; use `helm version` to check the `helm` version. This document was tested with version v3.6.2.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
In this step, you explore the staged WDT model YAML file and properties in the `${WDT_MODEL_FILES_PATH}/WLS-v1` directory. The model in this directory references the web application in your archive, configures a WebLogic Server Administration Server, and configures a WebLogic cluster. It consists of only two files, `model.10.properties`, a file with a single property, and, `model.10.yaml`, a YAML file with your WebLogic configuration.
2+
3+
Here is the WLS `model.10.properties`:
4+
5+
```
6+
CLUSTER_SIZE=5
7+
```
8+
9+
Here is the WLS `model.10.yaml`:
10+
11+
```yaml
12+
domainInfo:
13+
AdminUserName: '@@SECRET:__weblogic-credentials__:username@@'
14+
AdminPassword: '@@SECRET:__weblogic-credentials__:password@@'
15+
ServerStartMode: 'prod'
16+
17+
topology:
18+
Name: '@@ENV:CUSTOM_DOMAIN_NAME@@'
19+
AdminServerName: 'admin-server'
20+
Cluster:
21+
'cluster-1':
22+
DynamicServers:
23+
ServerTemplate: 'cluster-1-template'
24+
ServerNamePrefix: 'managed-server'
25+
DynamicClusterSize: '@@PROP:CLUSTER_SIZE@@'
26+
MaxDynamicClusterSize: '@@PROP:CLUSTER_SIZE@@'
27+
MinDynamicClusterSize: '0'
28+
CalculatedListenPorts: false
29+
Server:
30+
'admin-server':
31+
ListenPort: 7001
32+
ServerTemplate:
33+
'cluster-1-template':
34+
Cluster: 'cluster-1'
35+
ListenPort: 8001
36+
37+
appDeployments:
38+
Application:
39+
myapp:
40+
SourcePath: 'wlsdeploy/applications/myapp-v1'
41+
ModuleType: ear
42+
Target: 'cluster-1'
43+
```
44+
45+
The model file:
46+
47+
- Defines a WebLogic domain with:
48+
- Cluster `cluster-1`
49+
- Administration Server `admin-server`
50+
- An EAR application, targeted to `cluster-1`, located in the WDT archive ZIP file at `wlsdeploy/applications/myapp-v1`
51+
52+
- Leverages macros to inject external values:
53+
- The property file `CLUSTER_SIZE` property is referenced in the model YAML file `DynamicClusterSize` and `MaxDynamicClusterSize` fields using a PROP macro.
54+
- The model file domain name is injected using a custom environment variable named `CUSTOM_DOMAIN_NAME` using an ENV macro.
55+
- You set this environment variable later in this sample using an `env` field in its Domain.
56+
- _This conveniently provides a simple way to deploy multiple differently named domains using the same model image_.
57+
- The model file administrator user name and password are set using a `weblogic-credentials` secret macro reference to the WebLogic credential secret.
58+
- This secret is in turn referenced using the `webLogicCredentialsSecret` field in the Domain.
59+
- The `weblogic-credentials` is a reserved name that always dereferences to the owning Domain actual WebLogic credentials secret name.

0 commit comments

Comments
 (0)