Skip to content

Commit

Permalink
Merge branch 'update-aks-sample' into 'main'
Browse files Browse the repository at this point in the history
Update AKS sample

See merge request weblogic-cloud/weblogic-kubernetes-operator!4779

(cherry picked from commit f79af4a)

9a79487 modify model in image sample.
ff0a15a modify domain on PV sample
1f9ba6e Merge branch 'oracle:main' into update-aks-sample
  • Loading branch information
rjeberhard committed Aug 19, 2024
1 parent 8c74420 commit 2d94420
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This sample demonstrates how to use the [WebLogic Kubernetes Operator](https://o
#### Contents

- [Prerequisites](#prerequisites)
- [Prepare Parameters](#prepare-parameters)
- [Create Resource Group](#create-resource-group)
- [Create an AKS cluster](#create-the-aks-cluster)
- [Create and configure storage](#create-storage)
Expand All @@ -31,6 +30,31 @@ This sample demonstrates how to use the [WebLogic Kubernetes Operator](https://o

{{< readfile file="/samples/azure-kubernetes-service/includes/prerequisites-01.txt" >}}

##### Prepare parameters

```shell
# Change these parameters as needed for your own environment
export ORACLE_SSO_EMAIL=<replace with your oracle account email>
export ORACLE_SSO_PASSWORD="<replace with your oracle password>"

# Specify a prefix to name resources, only allow lowercase letters and numbers, between 1 and 7 characters
export BASE_DIR=~
export NAME_PREFIX=wls
export WEBLOGIC_USERNAME=weblogic
export WEBLOGIC_PASSWORD=Secret123456
export domainUID=domain1
# Used to generate resource names.
export TIMESTAMP=`date +%s`
export AKS_CLUSTER_NAME="${NAME_PREFIX}aks${TIMESTAMP}"
export AKS_PERS_RESOURCE_GROUP="${NAME_PREFIX}resourcegroup${TIMESTAMP}"
export AKS_PERS_LOCATION=eastus
export AKS_PERS_STORAGE_ACCOUNT_NAME="${NAME_PREFIX}storage${TIMESTAMP}"
export AKS_PERS_SHARE_NAME="${NAME_PREFIX}-weblogic-${TIMESTAMP}"
export SECRET_NAME_DOCKER="${NAME_PREFIX}regcred"
export ACR_NAME="${NAME_PREFIX}acr${TIMESTAMP}"

```

{{< readfile file="/samples/azure-kubernetes-service/includes/create-aks-cluster-body-01.txt" >}}

##### Sign in with Azure CLI
Expand All @@ -56,38 +80,13 @@ The steps in this section show you how to sign in to the Azure CLI.
1. Set the subscription ID. Be sure to replace the placeholder with the appropriate value.

```shell
$ export SUBSCRIPTION_ID=<your-subscription-id>
$ export SUBSCRIPTION_ID=$(az account show --query id --output tsv)
$ az account set -s $SUBSCRIPTION_ID
```

{{% 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.
{{% /notice %}}

#### Prepare parameters

```shell
# Change these parameters as needed for your own environment
export ORACLE_SSO_EMAIL=<replace with your oracle account email>
export ORACLE_SSO_PASSWORD=<replace with your oracle password>

# Specify a prefix to name resources, only allow lowercase letters and numbers, between 1 and 7 characters
export BASE_DIR=~
export NAME_PREFIX=wls
export WEBLOGIC_USERNAME=weblogic
export WEBLOGIC_PASSWORD=Secret123456
export domainUID=domain1
# Used to generate resource names.
export TIMESTAMP=`date +%s`
export AKS_CLUSTER_NAME="${NAME_PREFIX}aks${TIMESTAMP}"
export AKS_PERS_RESOURCE_GROUP="${NAME_PREFIX}resourcegroup${TIMESTAMP}"
export AKS_PERS_LOCATION=eastus
export AKS_PERS_STORAGE_ACCOUNT_NAME="${NAME_PREFIX}storage${TIMESTAMP}"
export AKS_PERS_SHARE_NAME="${NAME_PREFIX}-weblogic-${TIMESTAMP}"
export SECRET_NAME_DOCKER="${NAME_PREFIX}regcred"
export ACR_NAME="${NAME_PREFIX}acr${TIMESTAMP}"

```

{{< readfile file="/samples/azure-kubernetes-service/includes/download-samples-zip.txt" >}}

{{< readfile file="/samples/azure-kubernetes-service/includes/create-resource-group.txt" >}}
Expand Down
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.8, 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.2.5, 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.8/sample-scripts.zip \
$ curl -m 120 -fL https://github.com/oracle/weblogic-kubernetes-operator/releases/download/v4.2.5/sample-scripts.zip \
-o ${BASE_DIR}/sample-scripts/sample-scripts.zip
$ unzip ${BASE_DIR}/sample-scripts/sample-scripts.zip -d ${BASE_DIR}/sample-scripts
```
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Update the repo to get the latest Helm charts. It is a best practice to do this
$ helm repo update
$ helm install weblogic-operator weblogic-operator/weblogic-operator \
--namespace sample-weblogic-operator-ns \
--version 4.1.8 \
--version 4.2.5 \
--set serviceAccount=sample-weblogic-operator-sa \
--wait
```
Expand All @@ -115,7 +115,7 @@ REVISION: 1
TEST SUITE: None
```

{{% notice tip %}} If you wish to use a more recent version of the operator, replace the `4.1.8` in the preceding command with the other version number. To see the list of versions, visit the [GitHub releases page](https://github.com/oracle/weblogic-kubernetes-operator/releases).
{{% notice tip %}} If you wish to use a more recent version of the operator, replace the `4.2.5` in the preceding command with the other version number. To see the list of versions, visit the [GitHub releases page](https://github.com/oracle/weblogic-kubernetes-operator/releases).
{{% /notice %}}


Expand All @@ -126,7 +126,7 @@ $ helm list -A
```
```
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
weblogic-operator sample-weblogic-operator-ns 1 2023-05-15 10:31:05.1890341 +0800 CST deployeweblogic-operator-4.1.8 4.1.8
weblogic-operator sample-weblogic-operator-ns 1 2023-05-15 10:31:05.1890341 +0800 CST deployeweblogic-operator-4.2.5 4.2.5
```
```shell
$ kubectl get pods -n sample-weblogic-operator-ns
Expand Down Expand Up @@ -696,15 +696,15 @@ Events: <none>
Access the Administration Console using the admin load balancer IP address.
```shell
$ ADMIN_SERVER_IP=$(kubectl -n sample-domain1-ns get svc sample-domain1-admin-server-external-lb -o=jsonpath='{.status.loadBalancer.ingress\[0\].ip}')
$ ADMIN_SERVER_IP=$(kubectl -n sample-domain1-ns get svc sample-domain1-admin-server-external-lb -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
$ echo "Administration Console Address: http://${ADMIN_SERVER_IP}:7001/console/"
```
Access the sample application using the cluster load balancer IP address.
```shell
## Access the sample application using the cluster load balancer IP.
$ CLUSTER_IP=$(kubectl -n sample-domain1-ns get svc sample-domain1-cluster-1-lb -o=jsonpath='{.status.loadBalancer.ingress\[0\].ip}')
$ CLUSTER_IP=$(kubectl -n sample-domain1-ns get svc sample-domain1-cluster-1-lb -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
```

```shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ initialize() {

# Generate Azure resource name

export image_build_branch_name="v4.1.1"
export image_build_branch_name="v4.2.5"
export image_build_base_dir="/tmp/tmp${azureResourceUID}"

export acr_account_name=${namePrefix}acr${azureResourceUID}
Expand Down

0 comments on commit 2d94420

Please sign in to comment.