-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
1d6074b
commit 8613f9d
Showing
12 changed files
with
329 additions
and
434 deletions.
There are no files selected for viewing
308 changes: 149 additions & 159 deletions
308
documentation/site/content/samples/azure-kubernetes-service/domain-on-pv.md
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
documentation/site/content/samples/azure-kubernetes-service/includes/aks-connect-acr.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
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). | ||
|
||
```shell | ||
$ export ACR_ID=$(az acr show -n $ACR_NAME --resource-group $AKS_PERS_RESOURCE_GROUP --query "id" -o tsv) | ||
$ az aks update --name $AKS_CLUSTER_NAME --resource-group $AKS_PERS_RESOURCE_GROUP --attach-acr $ACR_ID | ||
``` | ||
|
||
Successful output will be a JSON object with the entry `"type": "Microsoft.ContainerService/ManagedClusters"`. |
24 changes: 24 additions & 0 deletions
24
documentation/site/content/samples/azure-kubernetes-service/includes/create-acr.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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/). | ||
|
||
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. | ||
|
||
```shell | ||
$ az acr create --resource-group $AKS_PERS_RESOURCE_GROUP --name $ACR_NAME --sku Basic --admin-enabled true | ||
``` | ||
|
||
Closely examine the JSON output from this command. Save the value of the `loginServer` property aside. It will look something like the following. | ||
|
||
```json | ||
"loginServer": "contosoresourcegroup1610068510.azurecr.io", | ||
``` | ||
|
||
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. | ||
|
||
```shell | ||
$ export LOGIN_SERVER=$(az acr show -n $ACR_NAME --resource-group $AKS_PERS_RESOURCE_GROUP --query "loginServer" -o tsv) | ||
``` | ||
```shell | ||
$ az acr login --name $LOGIN_SERVER | ||
``` | ||
|
||
Successful output will include `Login Succeeded`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...mentation/site/content/samples/azure-kubernetes-service/includes/download-samples-zip.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
##### Download the WebLogic Kubernetes Operator sample. | ||
|
||
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. | ||
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. | ||
|
||
```shell | ||
$ cd $BASE_DIR | ||
$ mkdir sample-scripts | ||
$ curl -m 120 -fL https://github.com/oracle/weblogic-kubernetes-operator/releases/download/v4.1.7/sample-scripts.zip \ | ||
$ curl -m 120 -fL https://github.com/oracle/weblogic-kubernetes-operator/releases/download/v4.1.8/sample-scripts.zip \ | ||
-o ${BASE_DIR}/sample-scripts/sample-scripts.zip | ||
$ unzip ${BASE_DIR}/sample-scripts/sample-scripts.zip -d ${BASE_DIR}/sample-scripts | ||
``` |
28 changes: 28 additions & 0 deletions
28
documentation/site/content/samples/azure-kubernetes-service/includes/download-wls-tools.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
- 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. | ||
|
||
```shell | ||
$ curl -m 120 -fL https://github.com/oracle/weblogic-deploy-tooling/releases/latest/download/weblogic-deploy.zip \ | ||
-o ${WDT_MODEL_FILES_PATH}/weblogic-deploy.zip | ||
``` | ||
```shell | ||
$ curl -m 120 -fL https://github.com/oracle/weblogic-image-tool/releases/latest/download/imagetool.zip \ | ||
-o ${WDT_MODEL_FILES_PATH}/imagetool.zip | ||
``` | ||
|
||
- Set up the WebLogic Image Tool, run the following commands: | ||
```shell | ||
$ unzip ${WDT_MODEL_FILES_PATH}/imagetool.zip -d ${WDT_MODEL_FILES_PATH} | ||
``` | ||
|
||
``` | ||
$ ${WDT_MODEL_FILES_PATH}/imagetool/bin/imagetool.sh cache deleteEntry --key wdt_latest | ||
``` | ||
|
||
```shell | ||
$ ${WDT_MODEL_FILES_PATH}/imagetool/bin/imagetool.sh cache addInstaller \ | ||
--type wdt \ | ||
--version latest \ | ||
--path ${WDT_MODEL_FILES_PATH}/weblogic-deploy.zip | ||
``` | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
documentation/site/content/samples/azure-kubernetes-service/includes/staging-model-files.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
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. | ||
|
||
Here is the WLS `model.10.properties`: | ||
|
||
``` | ||
CLUSTER_SIZE=5 | ||
``` | ||
|
||
Here is the WLS `model.10.yaml`: | ||
|
||
```yaml | ||
domainInfo: | ||
AdminUserName: '@@SECRET:__weblogic-credentials__:username@@' | ||
AdminPassword: '@@SECRET:__weblogic-credentials__:password@@' | ||
ServerStartMode: 'prod' | ||
|
||
topology: | ||
Name: '@@ENV:CUSTOM_DOMAIN_NAME@@' | ||
AdminServerName: 'admin-server' | ||
Cluster: | ||
'cluster-1': | ||
DynamicServers: | ||
ServerTemplate: 'cluster-1-template' | ||
ServerNamePrefix: 'managed-server' | ||
DynamicClusterSize: '@@PROP:CLUSTER_SIZE@@' | ||
MaxDynamicClusterSize: '@@PROP:CLUSTER_SIZE@@' | ||
MinDynamicClusterSize: '0' | ||
CalculatedListenPorts: false | ||
Server: | ||
'admin-server': | ||
ListenPort: 7001 | ||
ServerTemplate: | ||
'cluster-1-template': | ||
Cluster: 'cluster-1' | ||
ListenPort: 8001 | ||
|
||
appDeployments: | ||
Application: | ||
myapp: | ||
SourcePath: 'wlsdeploy/applications/myapp-v1' | ||
ModuleType: ear | ||
Target: 'cluster-1' | ||
``` | ||
|
||
The model file: | ||
|
||
- Defines a WebLogic domain with: | ||
- Cluster `cluster-1` | ||
- Administration Server `admin-server` | ||
- An EAR application, targeted to `cluster-1`, located in the WDT archive ZIP file at `wlsdeploy/applications/myapp-v1` | ||
|
||
- Leverages macros to inject external values: | ||
- The property file `CLUSTER_SIZE` property is referenced in the model YAML file `DynamicClusterSize` and `MaxDynamicClusterSize` fields using a PROP macro. | ||
- The model file domain name is injected using a custom environment variable named `CUSTOM_DOMAIN_NAME` using an ENV macro. | ||
- You set this environment variable later in this sample using an `env` field in its Domain. | ||
- _This conveniently provides a simple way to deploy multiple differently named domains using the same model image_. | ||
- The model file administrator user name and password are set using a `weblogic-credentials` secret macro reference to the WebLogic credential secret. | ||
- This secret is in turn referenced using the `webLogicCredentialsSecret` field in the Domain. | ||
- The `weblogic-credentials` is a reserved name that always dereferences to the owning Domain actual WebLogic credentials secret name. |
Oops, something went wrong.